Skip to content

Node.js based forum software built for the modern web

use nodejs instead of node command if it exists

frissdiegurke64a1eab98041
diff --git a/nodebb b/nodebb
index f6c3a3d2a0..8c98a30fcf 100755
--- a/nodebb
+++ b/nodebb
@@ -4,6 +4,11 @@
# $1 action
# $2 subaction
+node="$(which nodejs 2>/dev/null)";
+if [ $? -gt 0 ];
+ then node="$(which node)";
+fi
+
function pidExists() {
if [ -e "pidfile" ];
then
@@ -29,7 +34,7 @@ case "$1" in
fi;
# Start the loader daemon
- node loader -d "$@"
+ "$node" loader -d "$@"
;;
stop)
@@ -77,24 +82,24 @@ case "$1" in
npm install
ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm install
ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm update
- node app --upgrade
+ "$node" app --upgrade
touch package.json
echo -e "\n\e[00;32mNodeBB Dependencies up-to-date!\e[00;00m";
;;
setup)
- node app --setup "$@"
+ "$node" app --setup "$@"
;;
reset)
- node app --reset --$2
+ "$node" app --reset --$2
;;
dev)
echo "Launching NodeBB in \"development\" mode."
echo "To run the production build of NodeBB, please use \"forever\"."
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)