added /abs/path/settings.json handling

before this path, one could only supply a relative path like:
 --settings ../relative/path/settings.js
now one can also use it with absolute paths like:
 --settings /abs/path/settings.json
This commit is contained in:
Joachim Schiele 2014-06-22 20:56:21 +02:00
parent b1b972a2b4
commit e17044d60e
1 changed files with 5 additions and 1 deletions

View File

@ -177,7 +177,11 @@ exports.abiwordAvailable = function()
exports.reloadSettings = function reloadSettings() {
// Discover where the settings file lives
var settingsFilename = argv.settings || "settings.json";
settingsFilename = path.resolve(path.join(exports.root, settingsFilename));
if (path.resolve(settingsFilename)===settingsFilename)
settingsFilename = path.resolve(settingsFilename);
else
settingsFilename = path.resolve(path.join(exports.root, settingsFilename));
var settingsStr;
try{