diff --git a/lib/server/console.js b/lib/server/console.js index 7bc3af5b..7e6907fd 100644 --- a/lib/server/console.js +++ b/lib/server/console.js @@ -102,13 +102,15 @@ */ function getOnMessage(connNum, callback, command) { var funcExec, firstChar, - connName, ret, isContain, + connName, ret, isVolume = win.isChangeVolume(command), isCD = command.match(new RegExp('^cd ')), isCDWin = command.match(new RegExp('^cd ', 'i')), symbolsExec = ['*', '&', '{', '}', '|', '\'', '"'], + isSymbol = Util.isContainStr(command, symbolsExec), + CWD = process.cwd(), dir = ClientDirs[connNum], options = { @@ -123,7 +125,7 @@ if (equalPart(command, CLOUDCMD)) ret = onCloudCmd(command, callback); - else if (isCD || isCDWin && WIN || isVolume) { + else if (!isSymbol && (isCD || isCDWin && WIN || isVolume)) { ret = true; onCD(command, dir, function(error, json) { @@ -151,7 +153,6 @@ }); funcExec = ClientFuncs[connNum]; - isContain = Util.isContainStr(command, symbolsExec); firstChar = command[0]; if (firstChar === '#') { @@ -162,7 +163,7 @@ Util.exec(callback, { stdout: command }, true); - } else if (WIN || firstChar === ' ' || isContain) + } else if (WIN || firstChar === ' ' || isSymbol) exec(command, options, funcExec); else setSpawn(command, options, callback);