🔧 chore(scripts): require flag-driven args
This commit is contained in:
@@ -49,7 +49,7 @@ first_skill_name() {
|
||||
|
||||
[ ! -d "$SKILLS_DST_ROOT" ]
|
||||
|
||||
sh "$SCRIPT_PATH"
|
||||
sh "$SCRIPT_PATH" -all
|
||||
|
||||
[ -d "$SKILLS_DST_ROOT" ]
|
||||
}
|
||||
@@ -57,7 +57,7 @@ first_skill_name() {
|
||||
@test "安装 - 复制 skill 目录" {
|
||||
skip_if_no_skills
|
||||
|
||||
sh "$SCRIPT_PATH"
|
||||
sh "$SCRIPT_PATH" -all
|
||||
|
||||
SKILL_DIRS=$(find "$SKILLS_DST_ROOT" -mindepth 1 -maxdepth 1 -type d)
|
||||
[ -n "$SKILL_DIRS" ]
|
||||
@@ -73,7 +73,7 @@ first_skill_name() {
|
||||
SKILL_NAME="$(first_skill_name)"
|
||||
[ -n "$SKILL_NAME" ]
|
||||
|
||||
sh "$SCRIPT_PATH" "$SKILL_NAME"
|
||||
sh "$SCRIPT_PATH" -skills "$SKILL_NAME"
|
||||
|
||||
[ -d "$SKILLS_DST_ROOT/$SKILL_NAME" ]
|
||||
COUNT=$(find "$SKILLS_DST_ROOT" -mindepth 1 -maxdepth 1 -type d | wc -l)
|
||||
@@ -89,7 +89,7 @@ first_skill_name() {
|
||||
mkdir -p "$SKILLS_DST_ROOT/$SKILL_NAME"
|
||||
echo "marker" > "$SKILLS_DST_ROOT/$SKILL_NAME/marker.txt"
|
||||
|
||||
sh "$SCRIPT_PATH" "$SKILL_NAME"
|
||||
sh "$SCRIPT_PATH" -skills "$SKILL_NAME"
|
||||
|
||||
BACKUP_DIRS=$(find "$SKILLS_DST_ROOT" -maxdepth 1 -type d -name "$SKILL_NAME.bak.*")
|
||||
[ -n "$BACKUP_DIRS" ]
|
||||
@@ -98,7 +98,7 @@ first_skill_name() {
|
||||
@test "错误处理 - 指定不存在 skill 报错" {
|
||||
skip_if_no_skills
|
||||
|
||||
run sh "$SCRIPT_PATH" nonexistent-skill
|
||||
run sh "$SCRIPT_PATH" -skills nonexistent-skill
|
||||
|
||||
[ "$status" -ne 0 ]
|
||||
}
|
||||
@@ -106,10 +106,10 @@ first_skill_name() {
|
||||
@test "幂等性 - 多次安装结果一致" {
|
||||
skip_if_no_skills
|
||||
|
||||
sh "$SCRIPT_PATH"
|
||||
sh "$SCRIPT_PATH" -all
|
||||
CHECKSUM1=$(find "$SKILLS_DST_ROOT" -type f -name "SKILL.md" ! -path "$SKILLS_DST_ROOT"'/*.bak.*/*' -exec md5sum {} \; | sort | md5sum)
|
||||
|
||||
sh "$SCRIPT_PATH"
|
||||
sh "$SCRIPT_PATH" -all
|
||||
CHECKSUM2=$(find "$SKILLS_DST_ROOT" -type f -name "SKILL.md" ! -path "$SKILLS_DST_ROOT"'/*.bak.*/*' -exec md5sum {} \; | sort | md5sum)
|
||||
|
||||
[ "$CHECKSUM1" = "$CHECKSUM2" ]
|
||||
|
||||
@@ -35,30 +35,16 @@ teardown() {
|
||||
[ -f "$SCRIPT_PATH" ]
|
||||
}
|
||||
|
||||
@test "sync_standards.sh 无参数时同步 tsl 规则集" {
|
||||
@test "sync_standards.sh - 未传 -langs 报错" {
|
||||
cd "$TEST_DIR"
|
||||
sh "$SCRIPT_PATH"
|
||||
run sh "$SCRIPT_PATH"
|
||||
|
||||
# 验证输出目录
|
||||
[ -d ".agents/tsl" ]
|
||||
[ -f ".agents/tsl/index.md" ]
|
||||
}
|
||||
|
||||
@test "sync_standards.sh 无参数时自动识别已有语言" {
|
||||
cd "$TEST_DIR"
|
||||
mkdir -p .agents/cpp
|
||||
echo "# placeholder" > .agents/cpp/index.md
|
||||
|
||||
sh "$SCRIPT_PATH"
|
||||
|
||||
[ -d ".agents/cpp" ]
|
||||
[ -f ".agents/cpp/index.md" ]
|
||||
[ ! -d ".agents/tsl" ]
|
||||
[ "$status" -ne 0 ]
|
||||
}
|
||||
|
||||
@test "sync_standards.sh tsl - 同步 TSL 规则集" {
|
||||
cd "$TEST_DIR"
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
# 验证必须文件
|
||||
[ -d ".agents/tsl" ]
|
||||
@@ -71,7 +57,7 @@ teardown() {
|
||||
|
||||
@test "sync_standards.sh cpp - 同步 C++ 规则集" {
|
||||
cd "$TEST_DIR"
|
||||
sh "$SCRIPT_PATH" cpp
|
||||
sh "$SCRIPT_PATH" -langs cpp
|
||||
|
||||
# 验证必须文件
|
||||
[ -d ".agents/cpp" ]
|
||||
@@ -84,7 +70,7 @@ teardown() {
|
||||
|
||||
@test "sync_standards.sh tsl cpp - 同步多个规则集" {
|
||||
cd "$TEST_DIR"
|
||||
sh "$SCRIPT_PATH" tsl cpp
|
||||
sh "$SCRIPT_PATH" -langs tsl,cpp
|
||||
|
||||
# 验证两个规则集都存在
|
||||
[ -d ".agents/tsl" ]
|
||||
@@ -100,7 +86,7 @@ teardown() {
|
||||
cd "$TEST_DIR"
|
||||
[ ! -f ".gitattributes" ]
|
||||
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
[ -f ".gitattributes" ]
|
||||
grep -q "Added from playbook .gitattributes" .gitattributes
|
||||
@@ -112,7 +98,7 @@ teardown() {
|
||||
echo "# My custom rules" > .gitattributes
|
||||
echo "*.custom binary" >> .gitattributes
|
||||
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
grep -q "# My custom rules" .gitattributes
|
||||
grep -q "*.custom binary" .gitattributes
|
||||
@@ -127,7 +113,7 @@ teardown() {
|
||||
EOF
|
||||
|
||||
export SYNC_GITATTR_MODE=block
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
# 验证 block 已更新(不再包含 "Old content")
|
||||
! grep -q "Old content" .gitattributes
|
||||
@@ -141,7 +127,7 @@ EOF
|
||||
cd "$TEST_DIR"
|
||||
[ ! -f "AGENTS.md" ]
|
||||
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
[ -f "AGENTS.md" ]
|
||||
grep -q ".agents/" AGENTS.md
|
||||
@@ -151,7 +137,7 @@ EOF
|
||||
cd "$TEST_DIR"
|
||||
echo "# My custom AGENTS.md" > AGENTS.md
|
||||
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
grep -q "# My custom AGENTS.md" AGENTS.md
|
||||
}
|
||||
@@ -164,7 +150,7 @@ EOF
|
||||
cd "$TEST_DIR"
|
||||
echo "# Original content" > .gitattributes
|
||||
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
# 验证备份文件存在
|
||||
[ -f ".gitattributes.bak."* ] || [ -f ".gitattributes.bak" ]
|
||||
@@ -175,7 +161,7 @@ EOF
|
||||
mkdir -p .agents/tsl
|
||||
echo "# Old index" > .agents/tsl/index.md
|
||||
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
# 验证备份目录存在
|
||||
[ -d ".agents/tsl.bak."* ] || [ -d ".agents/tsl.bak" ]
|
||||
@@ -193,7 +179,7 @@ EOF
|
||||
cp -r "$PLAYBOOK_ROOT/rulesets/python" docs/standards/playbook/rulesets/
|
||||
fi
|
||||
|
||||
sh "$SCRIPT_PATH" tsl cpp
|
||||
sh "$SCRIPT_PATH" -langs tsl,cpp
|
||||
|
||||
# 验证规则集不互相覆盖
|
||||
[ -d ".agents/tsl" ]
|
||||
@@ -211,7 +197,7 @@ EOF
|
||||
cd "$TEST_DIR"
|
||||
rm -rf docs/standards/playbook/rulesets
|
||||
|
||||
run sh "$SCRIPT_PATH" tsl
|
||||
run sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
[ "$status" -ne 0 ]
|
||||
}
|
||||
@@ -219,7 +205,7 @@ EOF
|
||||
@test "错误处理 - 无效语言参数时报错" {
|
||||
cd "$TEST_DIR"
|
||||
|
||||
run sh "$SCRIPT_PATH" invalid_lang
|
||||
run sh "$SCRIPT_PATH" -langs invalid_lang
|
||||
|
||||
[ "$status" -ne 0 ]
|
||||
}
|
||||
@@ -232,7 +218,7 @@ EOF
|
||||
cd "$TEST_DIR"
|
||||
export SYNC_GITATTR_MODE=skip
|
||||
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
[ ! -f ".gitattributes" ]
|
||||
}
|
||||
@@ -242,7 +228,7 @@ EOF
|
||||
echo "# Custom content" > .gitattributes
|
||||
export SYNC_GITATTR_MODE=overwrite
|
||||
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
# 验证自定义内容被覆盖
|
||||
! grep -q "# Custom content" .gitattributes
|
||||
@@ -253,7 +239,7 @@ EOF
|
||||
echo "# Custom rules only" > .gitattributes
|
||||
export SYNC_GITATTR_MODE=append
|
||||
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
grep -q "Added from playbook .gitattributes" .gitattributes
|
||||
grep -q "\\*.tsl" .gitattributes
|
||||
@@ -264,7 +250,7 @@ EOF
|
||||
cp "$PLAYBOOK_ROOT/.gitattributes" .gitattributes
|
||||
export SYNC_GITATTR_MODE=append
|
||||
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
|
||||
! grep -q "Added from playbook .gitattributes" .gitattributes
|
||||
}
|
||||
@@ -277,11 +263,11 @@ EOF
|
||||
cd "$TEST_DIR"
|
||||
|
||||
# 第一次同步
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
CHECKSUM1=$(find rulesets/tsl -type f -exec md5sum {} \; | sort | md5sum)
|
||||
|
||||
# 第二次同步
|
||||
sh "$SCRIPT_PATH" tsl
|
||||
sh "$SCRIPT_PATH" -langs tsl
|
||||
CHECKSUM2=$(find rulesets/tsl -type f -exec md5sum {} \; | sort | md5sum)
|
||||
|
||||
[ "$CHECKSUM1" = "$CHECKSUM2" ]
|
||||
|
||||
@@ -23,7 +23,7 @@ teardown() {
|
||||
}
|
||||
|
||||
@test "sync_templates.sh - 基础同步与占位符替换" {
|
||||
sh "$SCRIPT_PATH" -project-name "DemoProject" -date "2026-02-03" "$TARGET_DIR"
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -project-name "DemoProject" -date "2026-02-03"
|
||||
|
||||
[ -d "$TARGET_DIR/memory-bank" ]
|
||||
[ -f "$TARGET_DIR/memory-bank/project-brief.md" ]
|
||||
@@ -45,7 +45,7 @@ teardown() {
|
||||
echo "keep" > "$TARGET_DIR/memory-bank/keep.md"
|
||||
echo "keep" > "$TARGET_DIR/docs/prompts/keep.md"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR"
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR"
|
||||
|
||||
[ -f "$TARGET_DIR/memory-bank/keep.md" ]
|
||||
[ ! -f "$TARGET_DIR/memory-bank/project-brief.md" ]
|
||||
@@ -57,7 +57,7 @@ teardown() {
|
||||
mkdir -p "$TARGET_DIR/memory-bank"
|
||||
echo "marker" > "$TARGET_DIR/memory-bank/marker.txt"
|
||||
|
||||
sh "$SCRIPT_PATH" -force "$TARGET_DIR"
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -force
|
||||
|
||||
[ -f "$TARGET_DIR/memory-bank/project-brief.md" ]
|
||||
[ ! -f "$TARGET_DIR/memory-bank/marker.txt" ]
|
||||
@@ -78,7 +78,7 @@ OLD_FRAMEWORK
|
||||
Footer
|
||||
EOF
|
||||
|
||||
sh "$SCRIPT_PATH" -full "$TARGET_DIR"
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -full
|
||||
|
||||
! grep -q "OLD_FRAMEWORK" "$TARGET_DIR/AGENTS.md"
|
||||
grep -q "<!-- playbook:framework:start -->" "$TARGET_DIR/AGENTS.md"
|
||||
|
||||
@@ -47,7 +47,7 @@ teardown() {
|
||||
@test "vendor_playbook.sh - 单语言 vendoring (tsl)" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
# 验证快照目录结构
|
||||
[ -d "docs/standards/playbook" ]
|
||||
@@ -60,7 +60,7 @@ teardown() {
|
||||
@test "vendor_playbook.sh - 多语言 vendoring (tsl cpp)" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl cpp
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl,cpp
|
||||
|
||||
# 验证包含两种语言的文档
|
||||
[ -d "docs/standards/playbook/docs/tsl" ]
|
||||
@@ -76,7 +76,7 @@ teardown() {
|
||||
@test "vendor_playbook.sh - 自动执行 sync_standards" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
# 验证根目录已同步规则集
|
||||
[ -d ".agents/tsl" ]
|
||||
@@ -87,7 +87,7 @@ teardown() {
|
||||
@test "vendor_playbook.sh - 多语言自动同步" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl cpp
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl,cpp
|
||||
|
||||
# 验证两个规则集都已同步
|
||||
[ -d ".agents/tsl" ]
|
||||
@@ -102,7 +102,7 @@ teardown() {
|
||||
@test "vendor_playbook.sh - 生成 SOURCE.md" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
[ -f "docs/standards/playbook/SOURCE.md" ]
|
||||
grep -q "Source:" docs/standards/playbook/SOURCE.md
|
||||
@@ -112,7 +112,7 @@ teardown() {
|
||||
@test "vendor_playbook.sh - SOURCE.md 包含 commit hash" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
# 验证包含 commit hash(40个十六进制字符)
|
||||
grep -E "[0-9a-f]{40}" docs/standards/playbook/SOURCE.md
|
||||
@@ -121,7 +121,7 @@ teardown() {
|
||||
@test "vendor_playbook.sh - SOURCE.md 包含时间戳" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
# 验证包含日期格式 YYYY-MM-DD
|
||||
grep -E "[0-9]{4}-[0-9]{2}-[0-9]{2}" docs/standards/playbook/SOURCE.md
|
||||
@@ -134,7 +134,7 @@ teardown() {
|
||||
@test "裁剪 - 仅包含指定语言的文档" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
# 验证包含 TSL 文档
|
||||
[ -d "docs/standards/playbook/docs/tsl" ]
|
||||
@@ -148,7 +148,7 @@ teardown() {
|
||||
@test "裁剪 - 始终包含 common 目录" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
[ -d "docs/standards/playbook/docs/common" ]
|
||||
[ -f "docs/standards/playbook/docs/common/commit_message.md" ]
|
||||
@@ -157,7 +157,7 @@ teardown() {
|
||||
@test "裁剪 - 包含对应的模板文件" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" cpp
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs cpp
|
||||
|
||||
# 验证包含 C++ 模板
|
||||
[ -d "docs/standards/playbook/templates/cpp" ]
|
||||
@@ -171,7 +171,7 @@ teardown() {
|
||||
@test "裁剪 - 包含通用 CI 模板" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
[ -d "docs/standards/playbook/templates/ci" ]
|
||||
}
|
||||
@@ -179,7 +179,7 @@ teardown() {
|
||||
@test "vendor_playbook.sh - -apply-templates 应用模板到项目根目录" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" cpp -apply-templates
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs cpp -apply-templates
|
||||
|
||||
if [ -f "$PLAYBOOK_ROOT/templates/cpp/.clang-format" ]; then
|
||||
[ -f ".clang-format" ]
|
||||
@@ -198,13 +198,13 @@ teardown() {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
# 首次 vendor
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
# 在快照中添加标记文件
|
||||
touch docs/standards/playbook/OLD_MARKER
|
||||
|
||||
# 再次 vendor
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
# 验证旧标记不存在(已被覆盖)
|
||||
[ ! -f "docs/standards/playbook/OLD_MARKER" ]
|
||||
@@ -216,7 +216,7 @@ teardown() {
|
||||
# 确保 docs/standards 不存在
|
||||
[ ! -d "docs/standards" ]
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
[ -d "docs/standards/playbook" ]
|
||||
}
|
||||
@@ -231,7 +231,7 @@ teardown() {
|
||||
missing_dir="$TEST_DIR/missing-project"
|
||||
rm -rf "$missing_dir"
|
||||
|
||||
run sh "$SCRIPT_PATH" "$missing_dir" tsl
|
||||
run sh "$SCRIPT_PATH" -project-root "$missing_dir" -langs tsl
|
||||
|
||||
[ "$status" -ne 0 ]
|
||||
}
|
||||
@@ -239,7 +239,7 @@ teardown() {
|
||||
@test "错误处理 - 无效语言参数时报错" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
run sh "$SCRIPT_PATH" "$TARGET_DIR" invalid_lang
|
||||
run sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs invalid_lang
|
||||
|
||||
[ "$status" -ne 0 ]
|
||||
}
|
||||
@@ -248,7 +248,7 @@ teardown() {
|
||||
cd "$TARGET_DIR"
|
||||
rm -rf .git
|
||||
|
||||
run sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
run sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
# 应该给出警告但不失败
|
||||
[ "$status" -eq 0 ]
|
||||
@@ -261,7 +261,7 @@ teardown() {
|
||||
@test "完整性 - 验证所有必要文件已复制" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
# 验证关键文件
|
||||
[ -f "docs/standards/playbook/README.md" ]
|
||||
@@ -274,10 +274,10 @@ teardown() {
|
||||
@test "完整性 - 验证脚本可执行性" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
|
||||
# 验证同步脚本可执行
|
||||
run sh docs/standards/playbook/scripts/sync_standards.sh tsl
|
||||
run sh docs/standards/playbook/scripts/sync_standards.sh -langs tsl
|
||||
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
@@ -290,11 +290,11 @@ teardown() {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
# 第一次 vendor
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
CHECKSUM1=$(find docs/standards/playbook -type f -name "*.md" ! -name "SOURCE.md" -exec md5sum {} \; | sort | md5sum)
|
||||
|
||||
# 第二次 vendor
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" tsl
|
||||
sh "$SCRIPT_PATH" -project-root "$TARGET_DIR" -langs tsl
|
||||
CHECKSUM2=$(find docs/standards/playbook -type f -name "*.md" ! -name "SOURCE.md" -exec md5sum {} \; | sort | md5sum)
|
||||
|
||||
[ "$CHECKSUM1" = "$CHECKSUM2" ]
|
||||
|
||||
Reference in New Issue
Block a user