mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 10:09:04 +00:00
fix(console) getOnMessage: if isSymbol do not cd
This commit is contained in:
parent
4c9e9fbfec
commit
848dac0df1
1 changed files with 5 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue