Created
September 25, 2014 14:53
-
-
Save dmitrinesterenko/40ccbae358d7eec07a5e to your computer and use it in GitHub Desktop.
Precomit hook to check if there's a binding.pry left somewhere in your code
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 | |
# | |
# An example hook script to verify what is about to be committed. | |
# Called by "git commit" with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# To enable this hook, rename this file to "pre-commit". | |
grep -r --include "*.rb" pry . | |
if [ $? == 0 ]; then | |
echo "You have a binding.pry" | |
exit 1 | |
else | |
echo "not matched" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment