From 93b349231e27ea7e87789dc5e6ab1bb208acbe4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=82=A0=E9=9D=99=E8=90=9D=E8=8E=89?= Date: Wed, 15 Nov 2023 18:05:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dhusky=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E6=89=BE=E4=B8=8D=E5=88=B0npx=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#635)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .husky/commit-msg | 6 +++++- .husky/pre-commit | 6 +++++- .husky/prepare-commit-msg | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index ccfec39..b02e0a7 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,8 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx --no-install commitlint -e $GIT_PARAMS \ No newline at end of file +if [[ "$OS" == "Windows_NT" ]]; then + npx.cmd --no-install commitlint -e $GIT_PARAMS +else + npx --no-install commitlint -e $GIT_PARAMS +fi diff --git a/.husky/pre-commit b/.husky/pre-commit index c37466e..11709a7 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,8 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx lint-staged \ No newline at end of file +if [[ "$OS" == "Windows_NT" ]]; then + npx.cmd lint-staged +else + npx lint-staged +fi diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg index 6720567..ab3a6e8 100755 --- a/.husky/prepare-commit-msg +++ b/.husky/prepare-commit-msg @@ -3,4 +3,8 @@ [ -n "$CI" ] && exit 0 . "$(dirname "$0")/_/husky.sh" -exec < /dev/tty && npx git-cz --hook || true \ No newline at end of file +if [[ "$OS" == "Windows_NT" ]]; then + exec < /dev/tty && npx.cmd git-cz --hook || true +else + exec < /dev/tty && npx git-cz --hook || true +fi