loader now handles arguments and ./nodebb watch command updated to not use loader.

This commit is contained in:
Julian Lam
2014-02-22 03:01:54 -05:00
parent d6a1fad527
commit b64e5870b7
3 changed files with 12 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
var fork = require('child_process').fork,
start = function() {
var nbb = fork('./app', [], {
var nbb = fork('./app', process.argv.slice(2), {
env: {
'NODE_ENV': process.env.NODE_ENV
}
@@ -8,12 +8,16 @@ var fork = require('child_process').fork,
nbb.on('message', function(cmd) {
if (cmd === 'nodebb:restart') {
nbb.on('exit', function() {
start();
});
nbb.kill();
if (process.env.NODE_ENV !== 'development') {
nbb.on('exit', function() {
start();
});
nbb.kill();
} else {
console.log('[app] Development Mode is on, restart aborted.');
}
}
});
};
}
start();