Files
likang 3cbf7bda9a
CI / typecheck + test + build (push) Has been cancelled
Merge updated AI PCB session workflow into main
Integrate origin/main, including feature/new-ai-gate, with the saved local PCB work. Preserve project covers, packaging, platform authentication, macOS KiCad support and the AI disable switch. Mount only the new session workspace, align proxy defaults with port 8003, and resolve cross-platform and test integration issues.
2026-11-12 18:47:28 +08:00

25 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
# Existing Linux deployments can explicitly start the persistent-session units.
if [ "${1:-}" = --services ]; then
systemctl --user start vibemake-pcb2-session.service vibemake-pcb2-web.service
exec systemctl --user --no-pager status vibemake-pcb2-session.service vibemake-pcb2-web.service
fi
# A configured runtime is optional; ordinary Node 20+ installations also work.
if ! command -v node >/dev/null || [ "$(node -p 'Number(process.versions.node.split(".")[0])')" -lt 20 ]; then
runtime="$HOME/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin"
if [ -x "$runtime/node" ]; then export PATH="$runtime:$PATH"; else echo 'Please install Node.js 20+ (recommended 22 LTS) and npm first.'; exit 1; fi
fi
# Local configuration is read by Node's env parser, never evaluated as shell code.
node_args=()
if [ -f .env.local ]; then
node_args=("--env-file=$PWD/.env.local")
fi
if ! command -v npm >/dev/null; then echo 'npm is required to bootstrap the pinned pnpm version.'; exit 1; fi
if [ ! -d node_modules ]; then npm exec --yes --package=pnpm@10.33.0 -- pnpm install --frozen-lockfile; fi
if [ ! -f designer/dist/index.html ] || [ ! -f designer/dist/pcb-service-config.json ] || [ "${REBUILD:-0}" = 1 ] || find designer/src ai common -type f -newer designer/dist/index.html -print -quit | grep -q .; then
npm exec --yes --package=pnpm@10.33.0 -- pnpm -C designer build
fi
exec node "${node_args[@]}" scripts/serve.mjs