server: clean ~/ to home dir resolution code; resolve ~/ in remote-root
This commit is contained in:
parent
a8940779ba
commit
8f3513318f
3 changed files with 16 additions and 24 deletions
|
|
@ -17,6 +17,13 @@ module.exports = {
|
|||
|
||||
return copy
|
||||
|
||||
},
|
||||
|
||||
resolveHomeDir: function(p) {
|
||||
// Resolve '~' to user's home directory
|
||||
if (!p) return ''
|
||||
return String(p).replace(/^~/, process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'])
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue