🔧 chore(scripts): unify single-dash options
This commit is contained in:
+3
-3
@@ -102,10 +102,10 @@ sh check_doc_links.sh
|
||||
- **占位符替换**:
|
||||
- `{{PROJECT_NAME}}` 与 `{{DATE}}`
|
||||
- **目录覆盖策略**:
|
||||
- 无 `--force` 时不覆盖已有目录
|
||||
- `--force` 时覆盖并备份
|
||||
- 无 `-force` 时不覆盖已有目录
|
||||
- `-force` 时覆盖并备份
|
||||
- **AGENTS.md 更新**:
|
||||
- `--full` 更新 framework 区块
|
||||
- `-full` 更新 framework 区块
|
||||
|
||||
#### test_vendor_playbook.bats
|
||||
|
||||
|
||||
@@ -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-name "DemoProject" -date "2026-02-03" "$TARGET_DIR"
|
||||
|
||||
[ -d "$TARGET_DIR/memory-bank" ]
|
||||
[ -f "$TARGET_DIR/memory-bank/project-brief.md" ]
|
||||
@@ -39,7 +39,7 @@ teardown() {
|
||||
[ -z "$(find "$TARGET_DIR" -name '*.template.md' -print -quit)" ]
|
||||
}
|
||||
|
||||
@test "sync_templates.sh - 已存在目录不覆盖 (无 --force)" {
|
||||
@test "sync_templates.sh - 已存在目录不覆盖 (无 -force)" {
|
||||
mkdir -p "$TARGET_DIR/memory-bank"
|
||||
mkdir -p "$TARGET_DIR/docs/prompts"
|
||||
echo "keep" > "$TARGET_DIR/memory-bank/keep.md"
|
||||
@@ -53,11 +53,11 @@ teardown() {
|
||||
[ ! -f "$TARGET_DIR/docs/prompts/README.md" ]
|
||||
}
|
||||
|
||||
@test "sync_templates.sh - --force 覆盖并备份" {
|
||||
@test "sync_templates.sh - -force 覆盖并备份" {
|
||||
mkdir -p "$TARGET_DIR/memory-bank"
|
||||
echo "marker" > "$TARGET_DIR/memory-bank/marker.txt"
|
||||
|
||||
sh "$SCRIPT_PATH" --force "$TARGET_DIR"
|
||||
sh "$SCRIPT_PATH" -force "$TARGET_DIR"
|
||||
|
||||
[ -f "$TARGET_DIR/memory-bank/project-brief.md" ]
|
||||
[ ! -f "$TARGET_DIR/memory-bank/marker.txt" ]
|
||||
@@ -67,7 +67,7 @@ teardown() {
|
||||
[ -f "$backup_dir/marker.txt" ]
|
||||
}
|
||||
|
||||
@test "sync_templates.sh - --full 更新 framework 区块" {
|
||||
@test "sync_templates.sh - -full 更新 framework 区块" {
|
||||
cat > "$TARGET_DIR/AGENTS.md" << 'EOF'
|
||||
# Agent Instructions
|
||||
|
||||
@@ -78,7 +78,7 @@ OLD_FRAMEWORK
|
||||
Footer
|
||||
EOF
|
||||
|
||||
sh "$SCRIPT_PATH" --full "$TARGET_DIR"
|
||||
sh "$SCRIPT_PATH" -full "$TARGET_DIR"
|
||||
|
||||
! grep -q "OLD_FRAMEWORK" "$TARGET_DIR/AGENTS.md"
|
||||
grep -q "<!-- playbook:framework:start -->" "$TARGET_DIR/AGENTS.md"
|
||||
|
||||
@@ -176,10 +176,10 @@ teardown() {
|
||||
[ -d "docs/standards/playbook/templates/ci" ]
|
||||
}
|
||||
|
||||
@test "vendor_playbook.sh - --apply-templates 应用模板到项目根目录" {
|
||||
@test "vendor_playbook.sh - -apply-templates 应用模板到项目根目录" {
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" cpp --apply-templates
|
||||
sh "$SCRIPT_PATH" "$TARGET_DIR" cpp -apply-templates
|
||||
|
||||
if [ -f "$PLAYBOOK_ROOT/templates/cpp/.clang-format" ]; then
|
||||
[ -f ".clang-format" ]
|
||||
|
||||
Reference in New Issue
Block a user