|
|
|
@ -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)
|
|
|
|
|