SpaceNinjaServer/UPDATE AND START SERVER.sh
Sainan 325f402536
All checks were successful
Build / build (pull_request) Successful in 59s
chore: abort update and start scripts when .git folder is missing
In that case, updating is obviously not possible.
2025-08-27 00:32:53 +02:00

25 lines
477 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..."
npm i --omit=dev
npm run build
if [ $? -eq 0 ]; then
npm run start
echo "SpaceNinjaServer seems to have crashed."
fi
fi