File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 4141 return spawnify ;
4242 } ;
4343
44- function parseDir ( dir ) {
44+ function getHome ( ) {
4545 var HOME_WIN = process . env . HOMEPATH ,
4646 HOME_UNIX = process . env . HOME ,
47- HOME = HOME_WIN || HOME_UNIX ,
48- cwd = process . cwd ( ) ;
47+ HOME = HOME_WIN || HOME_UNIX ;
48+
49+ return HOME ;
50+ }
51+
52+ function parseDir ( dir ) {
53+ var home = getHome ( ) ,
54+ cwd = process . cwd ( ) ;
4955
5056 assert ( dir , 'dir should be string!' ) ;
5157
52- dir = dir . replace ( / ^ ~ / , HOME )
58+ dir = dir . replace ( / ^ ~ / , home )
5359 . replace ( / ^ \. / , cwd ) ;
5460
5561 return dir ;
234240 var wasError , strs ,
235241 self = this ,
236242 CD = 'cd ' ,
237- HOME = process . env . HOME ,
243+ HOME = getHome ( ) ,
238244
239245 isChangeVolume = win . isChangeVolume ( command ) ,
240246 isVolume = win . isVolume ( command ) ,
You can’t perform that action at this time.
0 commit comments