Created
October 16, 2014 08:38
-
-
Save tlync/0b66846a6a16794a6313 to your computer and use it in GitHub Desktop.
pre-push kuso edition
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 | |
CMD="sbt test" # Command that runs your tests | |
# Check if we actually have commits to push | |
#commits=`git log @{u}..` | |
#if [ -z "$commits" ]; then | |
# exit 0 | |
#fi | |
echo | |
read -p "…もちろん、ちゃんとテストしたよな?" -n 0 -r < /dev/tty | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
echo "嘘をつくんじゃない!!" | |
sleep 2 | |
fi | |
echo "確かめてやる" | |
sleep 1 | |
echo $CMD | |
$CMD | |
RESULT=$? | |
if [ $RESULT -ne 0 ]; then | |
echo "-------------------------" | |
echo "わしを甘くみるんじゃない! $CMD で落ちたぞ!" | |
echo "出直してから push しろ" | |
echo "-------------------------" | |
exit 1 | |
fi | |
echo "-------------------------" | |
echo "くっ… よかろう" | |
echo "-------------------------" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
まじめな方はこっち
https://gist.github.com/tlync/22da4866ca9a34241eac