Last active
August 29, 2015 14:15
-
-
Save Suor/7a7e8976e4dd3982a29b to your computer and use it in GitHub Desktop.
Never commit prints again
This file contains 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/sh | |
PRINTS=`git diff --cached -U0 | grep ^+ | grep -E '\bprint(\b|_)'` | |
if [ -n "$PRINTS" ]; then | |
echo "ERROR: you are going to commit prints:\n" | |
git diff --cached -U0 -G'\bprint(\b|_)' | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment