fix(console) getOnMessage: if isSymbol do not cd

This commit is contained in:
coderaiser 2014-07-09 02:43:51 -04:00
parent 4c9e9fbfec
commit 848dac0df1

View file

@ -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);