removing timeout before restarting nodebb, fixing nodebb executable

v1.18.x
Julian Lam 11 years ago
parent 64c4dd7e63
commit d6a1fad527

@ -2,16 +2,16 @@ var fork = require('child_process').fork,
start = function() { start = function() {
var nbb = fork('./app', [], { var nbb = fork('./app', [], {
env: { env: {
'NODE_ENV': 'development' 'NODE_ENV': process.env.NODE_ENV
} }
}); });
nbb.on('message', function(cmd) { nbb.on('message', function(cmd) {
if (cmd === 'nodebb:restart') { if (cmd === 'nodebb:restart') {
nbb.kill(); nbb.on('exit', function() {
setTimeout(function() {
start(); start();
}, 1000); });
nbb.kill();
} }
}); });
}; };

@ -6,57 +6,40 @@
case "$1" in case "$1" in
start) start)
node app "$@" node loader "$@"
;; ;;
upgrade) upgrade)
npm install npm install
ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm install ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm install
ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm update ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm update
node app --upgrade node loader --upgrade
touch package.json touch package.json
echo -e "\n\e[00;32mNodeBB Dependencies up-to-date!\e[00;00m"; echo -e "\n\e[00;32mNodeBB Dependencies up-to-date!\e[00;00m";
;; ;;
setup) setup)
node app --setup node loader --setup
;; ;;
reset) reset)
node app --reset node loader --reset
;; ;;
dev) dev)
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 node app "$@" NODE_ENV=development node loader "$@"
;; ;;
watch) watch)
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' -- app "$@" NODE_ENV=development supervisor -q --extensions 'node|js|tpl' -- loader "$@"
;; ;;
# language)
# case "$2" in
# check)
# node app --language="check"
# ;;
# *)
# echo "Language Settings"
# echo $"Usage: $0 language {check}"
# echo ''
# column -s ' ' -t <<< '
# check Compare language files against the /en directory
# '
# ;;
# esac
# ;;
*) *)
echo "Welcome to NodeBB" echo "Welcome to NodeBB"
echo $"Usage: $0 {start|dev|watch|upgrade}" echo $"Usage: $0 {start|dev|watch|upgrade}"

Loading…
Cancel
Save