Skip to content

Commit

Permalink
update pre-commit hook to notify when a previous commit hook stash ex…
Browse files Browse the repository at this point in the history
…ists, and exit non-zero
  • Loading branch information
trusktr committed Oct 31, 2023
1 parent 3da16c5 commit e2bdcc7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# If a previous commit attempt's stash still exists, notify, and exit.
(git stash list | grep COMMIT_HOOK_STASH) && echo "A previous git stash named "COMMIT_HOOK_STASH" exists. Please handle and remove the stash then try again." && exit 1

git reset dist
git checkout dist
git stash save -k COMMIT_HOOK_STASH
Expand Down

0 comments on commit e2bdcc7

Please sign in to comment.