Skip to content

Commit 1e7a112

Browse files
committed
update husky scripts to use lefthook for commit preparation
1 parent fa04beb commit 1e7a112

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

.husky/_/pre-commit

100644100755
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ call_lefthook()
3232
elif test -f "$dir/node_modules/lefthook/bin/index.js"
3333
then
3434
"$dir/node_modules/lefthook/bin/index.js" "$@"
35-
35+
3636
elif bundle exec lefthook -h >/dev/null 2>&1
3737
then
3838
bundle exec lefthook "$@"
@@ -48,13 +48,10 @@ call_lefthook()
4848
elif command -v mint >/dev/null 2>&1
4949
then
5050
mint run csjones/lefthook-plugin "$@"
51-
elif command -v npx >/dev/null 2>&1
52-
then
53-
npx lefthook "$@"
5451
else
5552
echo "Can't find lefthook in PATH"
5653
fi
5754
fi
5855
}
5956

60-
call_lefthook run "pre-commit" "$@"
57+
call_lefthook run "pre-commit" "$@"

.husky/_/prepare-commit-msg

100644100755
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ call_lefthook()
3232
elif test -f "$dir/node_modules/lefthook/bin/index.js"
3333
then
3434
"$dir/node_modules/lefthook/bin/index.js" "$@"
35-
35+
3636
elif bundle exec lefthook -h >/dev/null 2>&1
3737
then
3838
bundle exec lefthook "$@"
@@ -48,13 +48,10 @@ call_lefthook()
4848
elif command -v mint >/dev/null 2>&1
4949
then
5050
mint run csjones/lefthook-plugin "$@"
51-
elif command -v npx >/dev/null 2>&1
52-
then
53-
npx lefthook "$@"
5451
else
5552
echo "Can't find lefthook in PATH"
5653
fi
5754
fi
5855
}
5956

60-
call_lefthook run "prepare-commit-msg" "$@"
57+
call_lefthook run "prepare-commit-msg" "$@"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"storybook:build": "storybook build",
2323
"release": "pnpm build && pnpm release-it",
2424
"link:self": "pnpm link --global",
25-
"prepare": "husky"
25+
"prepare": "lefthook install"
2626
},
2727
"types": "./dist/index.d.ts",
2828
"exports": {
@@ -118,4 +118,4 @@
118118
"@emotion/styled": "^11.14.0",
119119
"react-resize-detector": "^12.0.2"
120120
}
121-
}
121+
}

0 commit comments

Comments
 (0)