From a6c278a5743ee093dc6493defda4d55cbc28829b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 24 Jul 2014 05:45:58 -0400 Subject: [PATCH] fix(console) change dir if current dir removed --- lib/server/console.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/server/console.js b/lib/server/console.js index f8576608..2e1ecae3 100644 --- a/lib/server/console.js +++ b/lib/server/console.js @@ -282,10 +282,12 @@ isRootOrHome = equalPart(paramDir, ['/', '~']), getDir = WIN ? 'chdir' : 'pwd'; - if (!isRootOrHome && !isChangeVolume || isVolume) - command = 'cd ' + path.join(currDir, paramDir); + if (!isRootOrHome && !isChangeVolume || isVolume) { + paramDir = path.join(currDir, paramDir); + command = 'cd ' + paramDir; + } - exec(command + ' && ' + getDir, {cwd : currDir}, function (error, stdout, stderr) { + exec(command + ' && ' + getDir, {cwd : paramDir}, function (error, stdout, stderr) { var errorStr = ''; if (stderr)