From 2775d4cfc6dde9d20ea28d4aa5c02a66d3aa8493 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 8 Jul 2014 04:30:00 -0400 Subject: [PATCH] fix(console) getOnMessage onCD: if error do not change path --- lib/server/console.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/server/console.js b/lib/server/console.js index 4f982234..e0343a64 100644 --- a/lib/server/console.js +++ b/lib/server/console.js @@ -115,11 +115,15 @@ else if (equalPart(command, 'cd ')) { ret = true; - onCD(command, dir, function(json) { - var path = json.path; + onCD(command, dir, function(error, json) { + var path = ''; + + if (!error) { + path = json.path; + ClientDirs[connNum] = path; + } callback(json); - ClientDirs[connNum] = path; }); } @@ -275,7 +279,7 @@ if (errorData) errorStr = Util.stringifyJSON(errorData); - Util.exec(callback, { + callback(errorData, { stderr : errorStr, path : CloudFunc.rmNewLine(stdout) });