Skip to content

Instantly share code, notes, and snippets.

@davejlong
Last active August 29, 2015 14:02
Show Gist options
  • Save davejlong/dd7e3b15ea771746a220 to your computer and use it in GitHub Desktop.
Save davejlong/dd7e3b15ea771746a220 to your computer and use it in GitHub Desktop.
Runs the `develop` rake task before allowing a user to commit.
#!/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