mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
fix(console) cd to ~ and do something else
This commit is contained in:
parent
0b4efe42a2
commit
7ffef6df72
1 changed files with 4 additions and 2 deletions
|
|
@ -280,12 +280,14 @@
|
|||
isChangeVolume = win.isChangeVolume(command),
|
||||
isVolume = win.isVolume(command),
|
||||
paramDir = Util.rmStrOnce(command, [CD, 'cd']),
|
||||
|
||||
regExpHome = /^~$|^~\s/,
|
||||
isRoot = paramDir === '/',
|
||||
isHome = paramDir === '~' && !WIN;
|
||||
isHome = paramDir.match(regExpHome) && !WIN;
|
||||
|
||||
if (isHome) {
|
||||
paramDir = process.env.HOME;
|
||||
command = 'cd ' + paramDir;
|
||||
command = command.replace('~', paramDir);
|
||||
}
|
||||
|
||||
if (!paramDir && !WIN)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue