diff options
author | New Tobin Paradigm <email@mattatobin.com> | 2018-04-20 09:40:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-20 09:40:46 -0400 |
commit | 19730b493ad7269a88a2802f9ad6ade192c80334 (patch) | |
tree | aa6c4f0e4cba309789db7044964e89691581f296 | |
parent | a137076855b0b6d638297e737ce8145ac8226d3b (diff) | |
parent | 10ad43c854b2e6bb1ae701e97e7f7cb571f6fb81 (diff) | |
download | uxp-19730b493ad7269a88a2802f9ad6ade192c80334.tar.gz |
Merge pull request #213 from janekptacijarabaci/cmd_migration_1
moebius#144: Launch command: basilisk "-migration -p" (throws an error)
-rw-r--r-- | toolkit/components/xulstore/XULStore.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/toolkit/components/xulstore/XULStore.js b/toolkit/components/xulstore/XULStore.js index c2721327c2..8b5bc13131 100644 --- a/toolkit/components/xulstore/XULStore.js +++ b/toolkit/components/xulstore/XULStore.js @@ -63,11 +63,21 @@ XULStore.prototype = { load: function () { Services.obs.addObserver(this, "profile-before-change", true); - this._storeFile = Services.dirsvc.get("ProfD", Ci.nsIFile); + let profileType = "ProfD"; + try { + this._storeFile = Services.dirsvc.get(profileType, Ci.nsIFile); + } catch (ex) { + try { + profileType = "ProfDS"; + this._storeFile = Services.dirsvc.get(profileType, Ci.nsIFile); + } catch (ex) { + throw new Error("Can't find profile directory."); + } + } this._storeFile.append(STOREDB_FILENAME); if (!this._storeFile.exists()) { - this.import(); + this.import(profileType); } else { this.readFile(); } @@ -90,8 +100,8 @@ XULStore.prototype = { Services.console.logStringMessage("XULStore: " + message); }, - import: function() { - let localStoreFile = Services.dirsvc.get("ProfD", Ci.nsIFile); + import(profileType) { + let localStoreFile = Services.dirsvc.get(profileType || "ProfD", Ci.nsIFile); localStoreFile.append("localstore.rdf"); if (!localStoreFile.exists()) { |