Last active
December 29, 2015 13:09
-
-
Save nethad/7674981 to your computer and use it in GitHub Desktop.
git pre-commit hook for illegal code lines
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
# git-hooks/pre-commit/binding-pry.sh | |
FOCUS_FILES=`git diff-index --cached --name-only HEAD | xargs grep 'binding.pry' | wc -l` | |
if [ $FOCUS_FILES -gt 0 ] | |
then | |
echo "[pre-commit] You have at least 1 file with a 'binding.pry' call, please remove first." | |
exit 1 | |
fi |
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
# .git/hooks/pre-commit | |
#!/usr/bin/env sh | |
source ~/path/to/your/git-hooks/pre-commit/binding-pry.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment