mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 771466 - GCLI devtools.command.dir option should accept ~ for home directory; r=jwalker
This commit is contained in:
parent
4024e0dd8f
commit
40234f7436
@ -601,6 +601,16 @@ XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
|
||||
return;
|
||||
}
|
||||
|
||||
// replaces ~ with the home directory path in unix and windows
|
||||
if (dirName.indexOf("~") == 0) {
|
||||
let dirService = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties);
|
||||
let homeDirFile = dirService.get("Home", Ci.nsIFile);
|
||||
let homeDir = homeDirFile.path;
|
||||
dirName = dirName.substr(1);
|
||||
dirName = homeDir + dirName;
|
||||
}
|
||||
|
||||
let promise = OS.File.stat(dirName);
|
||||
promise = promise.then(
|
||||
function onSuccess(stat) {
|
||||
|
Loading…
Reference in New Issue
Block a user