Harness governance / validate (push) Has been cancelled
Initialize the full harness coding document set from the harness_coding_docs template, customized for the SoftBox project: - Vision, requirements, tech stack (modern Go 1.25 + Gio v0.10.1; Win7 legacy Go 1.20.14 + Gio v0.6.0), architecture, coding rules - Protocol contracts (signed catalog, package protocol v1, Ed25519 license, events, CLI) and Gio view structure - Roadmap Phase 0-6 with 20 suggested tasks; T-001 (monorepo skeleton) filed and ready to claim - Agent entry points (AGENTS.md, docs/00-ai-start-here.md), context manifest, governance scripts and tests - Merge Go gitignore with harness rules; keep go.work tracked Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
53 lines
1.9 KiB
Bash
Executable File
53 lines
1.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# 标准启动与验证入口(Unix shell 版),与 init.ps1 等价,二选一:
|
|
# - WSL / Git Bash / macOS / Linux:用本文件 ./init.sh
|
|
# - Windows 原生 PowerShell:用 ./init.ps1
|
|
# 一条命令完成:依赖安装 -> 基础验证 -> 打印启动命令。
|
|
# 复制到新项目后,必须先替换下面三个变量,让每轮会话用同一条路径启动,不靠记忆。
|
|
# 本文件不绑定任何技术栈;换技术栈时只替换这三个变量,脚本结构不用动。
|
|
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$ROOT_DIR"
|
|
|
|
# 按你的项目实际情况替换这三个命令。未替换前脚本会主动失败。
|
|
INSTALL_CMD=(__REPLACE_INSTALL_CMD__) # 依赖安装,如 uv sync、poetry install、npm install
|
|
VERIFY_CMD=(__REPLACE_VERIFY_CMD__) # 基础验证 / smoke,如 python -m pytest、go test ./...
|
|
START_CMD=(__REPLACE_START_CMD__) # 开发启动,如 uvicorn app:app --reload、npm run dev
|
|
|
|
ensure_configured() {
|
|
local name="$1"
|
|
local first="$2"
|
|
if [[ "$first" == __REPLACE_* ]]; then
|
|
echo "ERROR: 请先在 init.sh 中替换 ${name}。"
|
|
echo " 同步更新 docs/03-tech-stack.md、docs/00-ai-start-here.md 和 docs/current-state.md 中的命令。"
|
|
exit 2
|
|
fi
|
|
}
|
|
|
|
ensure_configured "INSTALL_CMD" "${INSTALL_CMD[0]}"
|
|
ensure_configured "VERIFY_CMD" "${VERIFY_CMD[0]}"
|
|
ensure_configured "START_CMD" "${START_CMD[0]}"
|
|
|
|
echo "==> 当前目录: $PWD"
|
|
|
|
echo "==> 同步依赖"
|
|
"${INSTALL_CMD[@]}"
|
|
|
|
echo "==> 运行基础验证"
|
|
"${VERIFY_CMD[@]}"
|
|
|
|
echo "==> 启动命令"
|
|
printf ' %q' "${START_CMD[@]}"
|
|
printf '\n'
|
|
|
|
if [ "${RUN_START_COMMAND:-0}" = "1" ]; then
|
|
echo "==> 启动应用"
|
|
exec "${START_CMD[@]}"
|
|
fi
|
|
|
|
echo "如果希望 init.sh 直接启动应用,请设置 RUN_START_COMMAND=1。"
|
|
echo "如果基础验证失败,先修复基线状态,不要在坏的起点上继续叠新功能。"
|