fix: 修复husky可能找不到npx命令的问题 (#635)

This commit is contained in:
悠静萝莉 2023-11-15 18:05:15 +08:00 committed by GitHub
parent 33b9eaccf2
commit 93b349231e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -1,4 +1,8 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint -e $GIT_PARAMS
if [[ "$OS" == "Windows_NT" ]]; then
npx.cmd --no-install commitlint -e $GIT_PARAMS
else
npx --no-install commitlint -e $GIT_PARAMS
fi

View File

@ -1,4 +1,8 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
if [[ "$OS" == "Windows_NT" ]]; then
npx.cmd lint-staged
else
npx lint-staged
fi

View File

@ -3,4 +3,8 @@
[ -n "$CI" ] && exit 0
. "$(dirname "$0")/_/husky.sh"
exec < /dev/tty && npx git-cz --hook || true
if [[ "$OS" == "Windows_NT" ]]; then
exec < /dev/tty && npx.cmd git-cz --hook || true
else
exec < /dev/tty && npx git-cz --hook || true
fi