-
-
Save carpeliam/a2ef3f5a8dd245fb0f34 to your computer and use it in GitHub Desktop.
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/sh | |
# | |
# To enable this hook, rename this file to "pre-commit". | |
PRY_PATTERN="require.+[\'\"]pry[\'\"]|binding\.pry" | |
# Redirect output to stderr. | |
exec 1>&2 | |
if git diff --cached | grep '^\+' | grep -q -E $PRY_PATTERN; then | |
echo "ERROR: There is left over pry stuff in this commit" | |
git diff --cached --name-only | xargs grep -n -H -E $PRY_PATTERN | |
exit 1 # reject | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment