fix(console) cd: if error in one of shell commands change directory

This commit is contained in:
coderaiser 2014-07-25 04:14:29 -04:00
parent 805f0e3554
commit b1aea5f7ad

View file

@ -130,9 +130,9 @@
ret = true;
onCD(command, dir, function(error, json) {
var path = '';
var path;
if (!error) {
if (json.path) {
path = json.path;
ClientDirs[connNum] = path;
}
@ -291,17 +291,20 @@
}
exec(command, {cwd : paramDir}, function (error, stdout, stderr) {
var errorStr = '';
var path = paramDir,
errorStr = '';
if (stderr)
if (stderr) {
errorStr = stderr;
else if (error)
} else if (error) {
errorStr = error.message;
path = '';
}
callback(error || stderr, {
stderr : addNewLine(errorStr),
stdout : stdout,
path : paramDir
path : path
});
});
}