XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
UTF-8
#!/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