You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.7 KiB
Bash
70 lines
1.7 KiB
Bash
#!/bin/bash
|
|
|
|
# $0 script path
|
|
# $1 action
|
|
# $2 subaction
|
|
|
|
case "$1" in
|
|
start)
|
|
node app
|
|
;;
|
|
|
|
upgrade)
|
|
echo "Upgrading dependencies (this command is intended to be run after a successful \"git pull\")";
|
|
read -p "Continue? " yn
|
|
case $yn in
|
|
[Yy]* )
|
|
npm install
|
|
ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm update
|
|
node app --upgrade
|
|
echo -e "\n\e[00;32mNodeBB Dependencies up-to-date!\e[00;00m";
|
|
;;
|
|
[Nn]* ) exit;;
|
|
* ) echo "Please answer yes or no.";;
|
|
esac
|
|
;;
|
|
|
|
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 app
|
|
;;
|
|
|
|
watch)
|
|
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 supervisor -q --extensions 'node|js|tpl' -- app $1
|
|
;;
|
|
|
|
# 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 $"Usage: $0 {start|dev|watch|language}"
|
|
echo ''
|
|
column -s ' ' -t <<< '
|
|
start Start NodeBB in production mode
|
|
dev Start NodeBB in development mode
|
|
watch Start NodeBB in development mode and watch for changes
|
|
upgrade Run NodeBB upgrade scripts, ensure packages are up-to-date
|
|
'
|
|
exit 1
|
|
esac
|