fix(console) change dir if current dir removed

This commit is contained in:
coderaiser 2014-07-24 05:45:58 -04:00
parent bf5f132893
commit a6c278a574

View file

@ -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)