#!/usr/bin/env bash
echo "Updating SpaceNinjaServer..."
git fetch --prune
if [ $? -eq 0 ]; then
git restore package-lock.json
git stash
git checkout -f origin/main
if [ -d "static/data/stripped-assets/" ]; then
echo "Updating stripped assets..."
cd static/data/stripped-assets/
git pull
cd ../../../
elif [ -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 --no-audit
npm run raw
else
npm i --omit=dev --no-audit
npm run build
if [ $? -eq 0 ]; then
npm run start
fi
fi
echo "SpaceNinjaServer seems to have crashed."
fi
#!/usr/bin/env bash
echo "Updating SpaceNinjaServer..."
git fetch --prune
if [ $? -eq 0 ]; then
git restore package-lock.json
git stash
git checkout -f origin/main
if [ -d "static/data/stripped-assets/" ]; then
echo "Updating stripped assets..."
cd static/data/stripped-assets/
git pull
cd ../../../
elif [ -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 --no-audit
npm run raw
else
npm i --omit=dev --no-audit
npm run build
if [ $? -eq 0 ]; then
npm run start
fi
fi
echo "SpaceNinjaServer seems to have crashed."
fi