@cmss/git-hooks-tool
v1.0.32
Published
A tool to handle Git commit hooks
Downloads
17
Readme
Git Hooks Tool
A tool to handle Git commit hooks using Husky.
Installation
请先安装pnpm
pnpm add @cmss/git-hooks-tool -D
Usage
.husk文件夹下增加prepare-commit-msg脚本,内容如下
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
exec < /dev/tty
pnpm exec prepare-commit ${1}
.husk文件夹下增加commit-msg脚本,内容如下
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
pnpm exec lint-commit ${1}
请确保husky下的脚本有可执行权限. 如果husky版本>=9,请移除 #! /usr/bin/env sh
和 . "$(dirname -- "$0")/_/husky.sh"