Created
May 15, 2012 19:57
-
-
Save freegenie/2704627 to your computer and use it in GitHub Desktop.
pre-commit hook to avoid commit of :focus
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/bash | |
# | |
# pre-commit hook, avoid committing :focus on rspec examples | |
focus=', :focus' | |
result=$(git grep -n $focus -- */**/*_spec.rb) | |
if [ "$result" != '' ]; then | |
echo "" | |
echo "Refusing to commit a :focus tag in specs: " | |
echo "" | |
echo $result | |
echo "" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment