Created
May 18, 2013 17:47
-
-
Save ryane/5605255 to your computer and use it in GitHub Desktop.
A pre-commit hook that forces specs to run if you are on the master branch
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 | |
if [ "$(git rev-parse --abbrev-ref HEAD)" == "master" ] | |
then | |
if [ -f FORCE_COMMIT ] | |
then | |
rm FORCE_COMMIT | |
exit 0 | |
else | |
echo "Running specs since you are committing to master..." | |
bundle exec rake db:migrate | |
bundle exec rake db:test:prepare | |
bundle exec rspec spec --order rand | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment