mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
fix(console) cd to full path
This commit is contained in:
parent
9ae54b7f28
commit
f48f7f1a2b
1 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue