settings: use makeAbsolute() for locating settings.json and credentials.json
This should look to consistent locations when looking for relative paths, without depending on current working directory. For absolute paths, nothing changes.pull/3473/head
parent
435b2a4edf
commit
8247d5eef3
|
@ -341,20 +341,10 @@ exports.getEpVersion = function() {
|
||||||
|
|
||||||
exports.reloadSettings = function reloadSettings() {
|
exports.reloadSettings = function reloadSettings() {
|
||||||
// Discover where the settings file lives
|
// Discover where the settings file lives
|
||||||
var settingsFilename = argv.settings || "settings.json";
|
var settingsFilename = absolutePaths.makeAbsolute(argv.settings || "settings.json");
|
||||||
|
|
||||||
// Discover if a credential file exists
|
// Discover if a credential file exists
|
||||||
var credentialsFilename = argv.credentials || "credentials.json";
|
var credentialsFilename = absolutePaths.makeAbsolute(argv.credentials || "credentials.json");
|
||||||
|
|
||||||
if (path.resolve(settingsFilename)===settingsFilename) {
|
|
||||||
settingsFilename = path.resolve(settingsFilename);
|
|
||||||
} else {
|
|
||||||
settingsFilename = path.resolve(path.join(exports.root, settingsFilename));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (path.resolve(credentialsFilename)===credentialsFilename) {
|
|
||||||
credentialsFilename = path.resolve(credentialsFilename);
|
|
||||||
}
|
|
||||||
|
|
||||||
var settingsStr, credentialsStr;
|
var settingsStr, credentialsStr;
|
||||||
try{
|
try{
|
||||||
|
|
Loading…
Reference in New Issue