| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # Make sure pwd is the directory of the script |
| 4 | cd "$(dirname "$0")" |
| 5 | |
| 6 | if ! command -v npm &> /dev/null |
| 7 | then |
| 8 | echo -e "\033[0;31mnpm could not be found in PATH. If the startup fails, please install Node.js from https://nodejs.org/\033[0m" |
| 9 | fi |
| 10 | |
| 11 | echo "Installing Node Modules..." |
| 12 | export NODE_ENV=production |
| 13 | npm install --no-save --no-audit --no-fund --loglevel=error --no-progress --omit=dev --ignore-scripts |
| 14 | |
| 15 | echo "Entering SillyTavern..." |
| 16 | node "server.js" "$@" |