- #!/usr/bin/env bash
- # 安装仓库级 git hooks:将 core.hooksPath 指向 .githooks/,启用提交前知识库校验。
- # 幂等,可重复执行。
- 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 (知识库提交前校验)"
|