SpaceNinjaServer/UPDATE AND START SERVER.sh
Sainan 8eefa76bd4
All checks were successful
Build / build (pull_request) Successful in 1m1s
chore: use raw running in update and start script if node is new enough
2025-09-04 07:51:50 +02:00

30 lines
640 B
Bash
Executable File

#!/bin/bash
echo "Updating SpaceNinjaServer..."
git fetch --prune
if [ $? -eq 0 ]; then
git stash
git checkout -f origin/main
if [ -d "static/data/0/" ]; then
echo "Updating stripped assets..."
cd static/data/0/
git pull
cd ../../../
fi
echo "Updating dependencies..."
node scripts/raw-precheck.js > /dev/null
if [ $? -eq 0 ]; then
npm i --omit=dev --omit=optional
npm run raw
else
npm i --omit=dev
npm run build
if [ $? -eq 0 ]; then
npm run start
fi
fi
echo "SpaceNinjaServer seems to have crashed."
fi