chore(V5.7): 增加中文提交信息校验门禁

This commit is contained in:
Codex
2026-08-11 03:07:45 +08:00
parent fd6be4f9b9
commit 2de796143f
7 changed files with 353 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env sh
HOOK_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
REPO_ROOT=$(git -C "$HOOK_DIR" rev-parse --show-toplevel 2>/dev/null)
if [ -z "$REPO_ROOT" ]; then
echo "FAIL: 无法确定 Git 仓库根目录,中文提交门禁未执行。" >&2
exit 1
fi
if ! command -v node >/dev/null 2>&1; then
echo "FAIL: 未找到 Node.js,无法执行中文提交门禁。" >&2
exit 1
fi
exec node "$REPO_ROOT/scripts/check-commit-message.mjs" --file "$1"