Merge pull request #1255 from theon/absolute-path-config

Allow absolute config paths
v1.18.x
Julian Lam 11 years ago
commit 1eab829dec

@ -66,7 +66,7 @@ winston.info('');
var configFile = __dirname + '/config.json', var configFile = __dirname + '/config.json',
configExists; configExists;
if (nconf.get('config')) { if (nconf.get('config')) {
configFile = path.join(__dirname, nconf.get('config')); configFile = path.resolve(__dirname, nconf.get('config'));
} }
configExists = fs.existsSync(configFile); configExists = fs.existsSync(configFile);

@ -444,7 +444,7 @@ var async = require('async'),
save: function (server_conf, callback) { save: function (server_conf, callback) {
var serverConfigPath = path.join(__dirname, '../config.json'); var serverConfigPath = path.join(__dirname, '../config.json');
if (nconf.get('config')) { if (nconf.get('config')) {
serverConfigPath = path.join(__dirname, '../', nconf.get('config')); serverConfigPath = path.resolve(__dirname, '../', nconf.get('config'));
} }
fs.writeFile(serverConfigPath, JSON.stringify(server_conf, null, 4), function (err) { fs.writeFile(serverConfigPath, JSON.stringify(server_conf, null, 4), function (err) {

Loading…
Cancel
Save