зеркало из https://github.com/mozilla/gecko-dev.git
Bug 771466 - GCLI devtools.command.dir option should accept ~ for home directory; r=jwalker
This commit is contained in:
Родитель
4f64ed4de2
Коммит
01c56fc0d5
|
@ -601,6 +601,16 @@ XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
|
||||||
return;
|
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);
|
let promise = OS.File.stat(dirName);
|
||||||
promise = promise.then(
|
promise = promise.then(
|
||||||
function onSuccess(stat) {
|
function onSuccess(stat) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче