1
0

commit-msg 461 B

12345678910
  1. #!/usr/bin/env bash
  2. # commit-msg 钩子:检查提交信息是否符合 README 附录「正式语法」
  3. # 启用:git config core.hooksPath .githooks
  4. # 可绕过:git commit --no-verify(远程 CI 门禁不可绕过)
  5. # 当前钩子所在目录 | Current Hook Directory
  6. HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  7. # 将退出码透传给 git | Pass through the exit code to git
  8. exec node "$HOOK_DIR/../scripts/check-grammar.mjs" --file "$1"