Last active
August 29, 2015 14:02
-
-
Save davejlong/dd7e3b15ea771746a220 to your computer and use it in GitHub Desktop.
Runs the `develop` rake task before allowing a user to commit.
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/bash | |
# Lets us read from the keyboard | |
exec < /dev/tty | |
bundle exec rake develop | |
passed=$? | |
if [ $passed -ne 0 ] | |
then | |
while true; do | |
read -p "Error when running \`bundle exec rake develop\`. Do you still want to commit? (y/N)" cont | |
if [ "$cont" == "" ]; then | |
cont='Y' | |
fi | |
case $cont in | |
[Yy] ) exit;; | |
[Nn] ) exit $passed;; | |
* ) echo "Please answer y or n for yes or no.";; | |
esac | |
done | |
else | |
echo "No errors while running \`bundle exec rake develop\`." | |
exit | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment