mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
Merge pull request #1255 from theon/absolute-path-config
Allow absolute config paths
This commit is contained in:
2
app.js
2
app.js
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user