Skip to content

Commit f3a9715

Browse files
committed
fix: Fix Husky precommit failures not blocking commit
1 parent af09928 commit f3a9715

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.husky/pre-commit

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
bash <<EOF
4+
if ! bash <<EOF
5+
set -e
56
TO_PRETTIFY="$(git diff --diff-filter=ACMTUXB --name-only --staged | grep -E -e '\.[jt]sx?$' -e '\.md$' -e '\.html$' -e '\.json$' || :) )"
67
if [[ -n "$TO_PRETTIFY" ]]; then npm run prettify $TO_PRETTIFY; fi
78
npm test
89
FAIL_ON_PENDING=true npm run notify-unpushed -- src/secrets
910
npm run secrets-check
1011
EOF
12+
then
13+
exit 1
14+
fi

0 commit comments

Comments
 (0)