- #!/bin/sh
- # 核心代码变更没有同时暂存协作文档时给出提醒,但不阻止提交。
- staged_files="$(git -c core.quotepath=false diff --cached --name-only --diff-filter=ACMR)"
- if printf '%s\n' "$staged_files" | grep -Eq '^(src/app/services/|server/routes/|cloud-functions/)'; then
- if ! printf '%s\n' "$staged_files" | grep -Eq '^(AGENTS\.md|docs/AI助手必读规范/.*\.md)$'; then
- printf '\n%s\n%s\n\n' \
- '============================================================' \
- '⚠️ 你改了核心代码但没更新协作文档,请确认 AGENTS.md 或 docs/AI助手必读规范/ 是否需要同步。'
- fi
- fi
- exit 0
|