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

2
nodebb
View File

@@ -37,7 +37,7 @@ case "$1" in
echo "Launching NodeBB in \"development\" mode." echo "Launching NodeBB in \"development\" mode."
echo "To run the production build of NodeBB, please use \"forever\"." echo "To run the production build of NodeBB, please use \"forever\"."
echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB" echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB"
NODE_ENV=development supervisor -q --extensions 'node|js|tpl' -- loader "$@" NODE_ENV=development supervisor -q --extensions 'node|js|tpl' -- app "$@"
;; ;;
*) *)

View File

@@ -55,9 +55,7 @@ var DebugRoute = function(app) {
}); });
app.get('/test', function(req, res) { app.get('/test', function(req, res) {
// categories.getModerators(1, function(err, mods) { res.send(200);
// res.json(mods);
// })
}); });
}); });