diff --git a/lib/server/console.js b/lib/server/console.js index 0bb7998d..cee8062f 100644 --- a/lib/server/console.js +++ b/lib/server/console.js @@ -108,11 +108,14 @@ * @param callback */ function getOnMessage(connNum, callback, command) { - var winCommand, symbolsExec, funcExec, firstChar, + var winCommand, funcExec, firstChar, connName, ret, isContain, - dir, options = {}; - - dir = ClientDirs[connNum]; + + symbolsExec = ['*', '&', '{', '}', '|', '\'', '"'], + dir = ClientDirs[connNum], + options = { + cwd: dir || DIR + }; if (!dir) dir = ClientDirs[connNum] = DIR; @@ -157,10 +160,8 @@ }); funcExec = ClientFuncs[connNum]; - symbolsExec = ['*', '&', '{', '}', '|', '\'', '"']; isContain = Util.isContainStr(command, symbolsExec); firstChar = command[0]; - options.cwd = dir; if (firstChar === '#') { command = command.slice(1);