From 6238873312ada5ca5f2e469af8bc865388882ab7 Mon Sep 17 00:00:00 2001 From: zijunchiang Date: Thu, 17 Sep 2026 05:21:54 +0800 Subject: [PATCH] =?UTF-8?q?chore(accept):=20accept-integration.sh=20?= =?UTF-8?q?=E6=8B=92=E7=BB=9D=E6=9C=AA=E7=9F=A5=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 首跑时把 --expect 当成位置参数传进来,被静默忽略(期望值路径只认 EXPECT_PATH 环境变量),于是 --skip-seed 时找不到期望值文件才报错 —— 属于 「参数写错却先跑一半」的糟糕体验。现在除 --skip-seed 外一律报错退出。 不影响发布产物(accept-integration.sh 不在 zip 内),故不新发版本。 --- build/accept-integration.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build/accept-integration.sh b/build/accept-integration.sh index 1a7d538..de5ac30 100755 --- a/build/accept-integration.sh +++ b/build/accept-integration.sh @@ -35,7 +35,14 @@ cd "$PROJECT_DIR" TARGET="${1:-}" SKIP_SEED=0 -for arg in "$@"; do [ "$arg" = "--skip-seed" ] && SKIP_SEED=1; done +# 只认 --skip-seed;其余参数一律报错退出,避免「参数写错被静默忽略」 +for arg in "$@"; do + case "$arg" in + --skip-seed) SKIP_SEED=1 ;; + "$TARGET") : ;; + *) echo "✗ 未知参数:$arg(只支持 --skip-seed;期望值路径用 EXPECT_PATH 环境变量)" >&2; exit 2 ;; + esac +done API_BASE="${API_BASE:-http://127.0.0.1:3000}" SAMPLES_DIR="${OPENDANCE_SAMPLES_DIR:-$PROJECT_DIR/../示例文件}"