use nodejs instead of node command if it exists

closes #1449
v1.18.x
frissdiegurke 11 years ago
parent ee12b4fd3e
commit 64a1eab980

@ -4,6 +4,11 @@
# $1 action # $1 action
# $2 subaction # $2 subaction
node="$(which nodejs 2>/dev/null)";
if [ $? -gt 0 ];
then node="$(which node)";
fi
function pidExists() { function pidExists() {
if [ -e "pidfile" ]; if [ -e "pidfile" ];
then then
@ -29,7 +34,7 @@ case "$1" in
fi; fi;
# Start the loader daemon # Start the loader daemon
node loader -d "$@" "$node" loader -d "$@"
;; ;;
stop) stop)
@ -77,24 +82,24 @@ case "$1" in
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" app --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" app --setup "$@"
;; ;;
reset) reset)
node app --reset --$2 "$node" app --reset --$2
;; ;;
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 loader --no-daemon "$@" NODE_ENV=development "$node" loader --no-daemon "$@"
;; ;;
watch) watch)

Loading…
Cancel
Save