fix(commitlint): husky hooks

This commit is contained in:
chrismclarke
2022-01-19 17:54:08 -08:00
parent 33f4af3151
commit ec1a8410a0
2 changed files with 19 additions and 0 deletions

12
.husky/common.sh Normal file
View File

@@ -0,0 +1,12 @@
# Common script to add support on windows
# https://typicode.github.io/husky/#/?id=yarn-on-windows
# https://github.com/commitizen/cz-cli/issues/627
command_exists () {
command -v "$1" >/dev/null 2>&1
}
# Workaround for Windows 10, Git Bash and Yarn
if command_exists winpty && test -t 1; then
exec < /dev/tty
fi

View File

@@ -0,0 +1,7 @@
#!/bin/sh
# Call common windows fix
. "$(dirname "$0")/common.sh"
# Call commitlint from bin (faster than yarn)
node_modules/.bin/commitlint --edit $1