JSPM

  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q60559F
  • License MIT

A tool to handle Git commit hooks

Package Exports

  • @cmss/git-hooks-tool
  • @cmss/git-hooks-tool/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@cmss/git-hooks-tool) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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"