- #!/usr/bin/env bash
- # 安装仓库级 git hooks:将 core.hooksPath 指向 .githooks/,启用提交前校验:
- # 1) 知识库校验(docs/参考资料/知识库 变更)
- # 2) 后端循环依赖强约束(cfc-backend/ 或 tools/check_circular_deps.py 变更,eager 环阻断)
- # 幂等,可重复执行。
- set -euo pipefail
- ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
- git -C "$ROOT" config core.hooksPath .githooks
- echo "hooksPath -> $(git -C "$ROOT" config core.hooksPath)"
- echo "已启用: $ROOT/.githooks/pre-commit (知识库 + 循环依赖 提交前校验)"
|