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

Allow absolute config paths
This commit is contained in:
Julian Lam
2014-03-27 13:10:29 -04:00
2 changed files with 2 additions and 2 deletions

2
app.js
View File

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

View File

@@ -444,7 +444,7 @@ var async = require('async'),
save: function (server_conf, callback) {
var serverConfigPath = path.join(__dirname, '../config.json');
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) {