mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
fix(console) cd: if error in one of shell commands change directory
This commit is contained in:
parent
805f0e3554
commit
b1aea5f7ad
1 changed files with 9 additions and 6 deletions
|
|
@ -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
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue