Created
January 13, 2021 01:43
-
-
Save jborden/57000cc2e351f057eab2642a4d417844 to your computer and use it in GitHub Desktop.
James Borden pre-commit git hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# comment to temporarily turn off testing | |
git diff --exit-code | |
RESULT=$? | |
[ $RESULT -ne 0 ] && exit 1 | |
if [[ -n $(git status --porcelain | grep ??) ]]; then | |
echo "There are untracked files" | |
exit 1 | |
fi | |
lein test | |
RESULT=$? | |
[ $RESULT -ne 0 ] && exit 1 | |
exit 0 | |
# Uncomment to temporarily turn off testing | |
# exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment