From 848dac0df17b108b2498b3da5f407e5224792f77 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 9 Jul 2014 02:43:51 -0400 Subject: [PATCH] fix(console) getOnMessage: if isSymbol do not cd --- lib/server/console.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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);