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

This commit is contained in:
Julian Lam
2015-04-27 22:41:44 -04:00
parent c98e630f24
commit f6ddff3e5f
2 changed files with 34 additions and 28 deletions

View File

@@ -246,6 +246,8 @@ nconf.argv().env().file({
file: path.join(__dirname, '/config.json')
});
fs.open(path.join(__dirname, 'config.json'), 'r', function(err) {
if (!err) {
if (nconf.get('daemon') !== false) {
if (fs.existsSync(pidFilePath)) {
try {
@@ -274,3 +276,8 @@ async.series([
console.log('[loader] Error during startup: ' + err.message);
}
});
} else {
// No config detected, kickstart web installer
var child = require('child_process').fork('app');
}
});

View File

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