fix(console) cd to full path

This commit is contained in:
coderaiser 2014-08-10 04:29:59 -04:00
parent 9ae54b7f28
commit f48f7f1a2b

View file

@ -289,9 +289,11 @@
paramDir = Util.rmStrOnce(command, [CD, 'cd']),
regExpHome = new RegExp('^~'),
regExpRoot = new RegExp('^[/\\\\]'),
isWildCard = Util.isContainStr(paramDir, ['*', '?']),
isHome = paramDir.match(regExpHome) && !WIN,
isRoot = paramDir.match(regExpRoot),
onExec = function (error, stdout, stderr) {
var path = paramDir,
@ -330,7 +332,7 @@
'"' + paramDir + '"',
]);
if (!isHome && paramDir !== '/')
if (!isHome && !isRoot)
paramDir = path.join(currDir, paramDir);
if (isWildCard)