docs: establish ShopHelm harness coding baseline

This commit is contained in:
QiuSW
2026-07-11 17:02:30 +08:00
parent 51fc27f5c3
commit e62b691b59
25 changed files with 2916 additions and 2 deletions
Executable
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# ShopHelm 标准启动与验证入口(WSL / Git Bash / macOS / Linux)。
# Windows 原生开发以 ./init.ps1 为权威入口;本文件保持等价命令。
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT_DIR"
if [[ ! -f go.mod ]]; then
echo "ERROR: 尚未找到 go.mod。当前应先完成 docs/06-tasks.md 的 T-001。"
exit 2
fi
INSTALL_CMD=(go mod download)
VERIFY_CMD=(go test ./...)
START_CMD=(go run ./cmd/shophelm)
echo "==> 当前目录: $PWD"
echo "==> 同步 Go 依赖"
"${INSTALL_CMD[@]}"
echo "==> 运行基础测试"
"${VERIFY_CMD[@]}"
echo "==> 开发启动命令"
printf ' %q' "${START_CMD[@]}"
printf '\n'
if [[ "${RUN_START_COMMAND:-0}" == "1" ]]; then
echo "==> 启动 ShopHelm"
exec "${START_CMD[@]}"
fi
echo "设置 RUN_START_COMMAND=1 可让 init.sh 在验证通过后启动应用。"