Skip to content

Commit d43173f

Browse files
committed
fix(husky): migrate to v9
1 parent 3d92572 commit d43173f

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

.husky/commit-msg

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
if [[ "$OS" == "Windows_NT" ]]; then
1+
if [ "$OS" = "Windows_NT" ]; then
52
npx.cmd --no-install commitlint -e $GIT_PARAMS
63
else
74
npx --no-install commitlint -e $GIT_PARAMS

.husky/pre-commit

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
if [[ "$OS" == "Windows_NT" ]]; then
5-
npx.cmd lint-staged
6-
else
7-
npx lint-staged
8-
fi
1+
lint-staged

.husky/prepare-commit-msg

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
#!/bin/sh
2-
[[ "$(uname -a)" = *"MINGW64"* ]] && exit 0
1+
case "$(uname -a)" in
2+
*MINGW64*) exit 0 ;;
3+
esac
4+
35
[ -n "$CI" ] && exit 0
4-
. "$(dirname "$0")/_/husky.sh"
56

6-
if [[ "$OS" == "Windows_NT" ]]; then
7+
if [ "$OS" = "Windows_NT" ]; then
78
exec < /dev/tty && npx.cmd git-cz --hook || true
89
else
910
exec < /dev/tty && npx git-cz --hook || true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"lint:fix": "eslint --ext .vue,.js,jsx,.ts,.tsx ./ --max-warnings 0 --fix",
1616
"stylelint": "stylelint src/**/*.{html,vue,sass,less}",
1717
"stylelint:fix": "stylelint --fix src/**/*.{html,vue,css,sass,less}",
18-
"prepare": "husky install",
18+
"prepare": "husky",
1919
"site:preview": "npm run build && cp -r dist _site",
2020
"test": "echo \"no test specified,work in process\"",
2121
"test:coverage": "echo \"no test:coverage specified,work in process\""

0 commit comments

Comments
 (0)