Files
ark-stronghold-protocol/scripts/start.sh
T
sganggs 01a44cd288 卫戍协议:盟约 web remake — initial import
Online co-op browser remake of Arknights' Stronghold Protocol: Alliance
(client-simulated combat, official waves/bonds/items/strategies, 3D board,
facing wheel, operator loadout, official emotes, deployment scripts).
2026-09-29 16:21:31 +08:00

28 lines
1.2 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 卫戍协议:盟约 · macOS / Linux start script. Docs: docs/DEPLOY.md
# scripts/start.sh [--port 3001] [--no-open] [--no-local] [--no-assets] … (arguments go to scripts/launch.mjs)
# Checks Node.js ≥ 18, runs `npm ci` on the first run, then scripts/launch.mjs (tools/setup.mjs → server → browser).
set -euo pipefail
cd "$(dirname "$0")/.."
if ! command -v node >/dev/null 2>&1; then
echo "未找到 Node.js(需要 18 或更高,推荐 22 LTS)。Node.js not found."
if [ "$(uname -s)" = "Darwin" ]; then
echo " 安装:brew install node@22 或 https://nodejs.org/zh-cn/download"
else
echo " 安装:https://nodejs.org/zh-cn/download (或发行版的包管理器 / nvm / fnm)"
fi
exit 1
fi
if ! node -e "process.exit(Number(process.versions.node.split('.')[0])>=18?0:1)"; then
echo "Node.js $(node -v) 太旧,需要 18 或更高(推荐 22 LTS):https://nodejs.org/zh-cn/download"
exit 1
fi
if [ ! -f node_modules/ws/package.json ]; then
echo "[首次运行] 正在安装依赖 npm ci …"
npm ci --no-audit --no-fund || npm install --no-audit --no-fund
fi
exec node scripts/launch.mjs "$@"