updated loader to kickstart the web installer if no config is found

v1.18.x
Julian Lam 10 years ago
parent c98e630f24
commit f6ddff3e5f

@ -246,7 +246,9 @@ nconf.argv().env().file({
file: path.join(__dirname, '/config.json')
});
if (nconf.get('daemon') !== false) {
fs.open(path.join(__dirname, 'config.json'), 'r', function(err) {
if (!err) {
if (nconf.get('daemon') !== false) {
if (fs.existsSync(pidFilePath)) {
try {
var pid = fs.readFileSync(pidFilePath, { encoding: 'utf-8' });
@ -263,14 +265,19 @@ if (nconf.get('daemon') !== false) {
});
fs.writeFile(__dirname + '/pidfile', process.pid);
}
}
async.series([
async.series([
Loader.init,
Loader.displayStartupMessages,
Loader.start
], function(err) {
], function(err) {
if (err) {
console.log('[loader] Error during startup: ' + err.message);
}
});
} else {
// No config detected, kickstart web installer
var child = require('child_process').fork('app');
}
});

@ -10,8 +10,7 @@
},
"main": "app.js",
"scripts": {
"start": "./nodebb start",
"stop": "./nodebb stop",
"start": "node loader.js",
"test": "mocha ./tests -t 10000"
},
"dependencies": {

Loading…
Cancel
Save