Create database when new data dir location is set in pref
Regression from new data directory handling
This commit is contained in:
parent
d88cfc6c5f
commit
06ad369368
|
@ -271,6 +271,8 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
|
|||
// Make sure that Zotero Standalone is not running as root
|
||||
if(Zotero.isStandalone && !Zotero.isWin) _checkRoot();
|
||||
|
||||
_addToolbarIcon();
|
||||
|
||||
try {
|
||||
var dataDir = Zotero.getZoteroDirectory();
|
||||
}
|
||||
|
@ -955,10 +957,6 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
|
|||
throw (e);
|
||||
}
|
||||
this.setDataDirectory(file.path);
|
||||
if (!file.exists()) {
|
||||
var e = { name: "NS_ERROR_FILE_NOT_FOUND" };
|
||||
throw (e);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If there's a migration marker in this directory and no database, migration was
|
||||
|
@ -991,6 +989,17 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!file.exists()) {
|
||||
// If useDataDir is set to ~/Zotero and it doesn't exist, create it
|
||||
if (file.path == this.getDefaultDataDir()) {
|
||||
Zotero.File.createDirectoryIfMissing(file);
|
||||
}
|
||||
else {
|
||||
let e = { name: "NS_ERROR_FILE_NOT_FOUND" };
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
let dataDir = this.getDefaultDataDir();
|
||||
|
|
Loading…
Reference in New Issue
Block a user