Add ability to reload settings

This commit is contained in:
Marcel Klehr 2012-11-06 17:35:05 +01:00
parent 7febd3ff5c
commit e702a86c9f
1 changed files with 45 additions and 38 deletions

View File

@ -112,6 +112,9 @@ exports.abiwordAvailable = function()
}
}
exports.reloadSettings = function reloadSettings() {
// Discover where the settings file lives
var settingsFilename = argv.settings || "settings.json";
settingsFilename = path.resolve(path.join(root, settingsFilename));
@ -160,3 +163,7 @@ for(var i in settings)
if(exports.dbType === "dirty"){
console.warn("DirtyDB is used. This is fine for testing but not recommended for production.")
}
}
// initially load settings
exports.reloadSettings();