Skip to content

Instantly share code, notes, and snippets.

@tlync
Created October 16, 2014 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlync/0b66846a6a16794a6313 to your computer and use it in GitHub Desktop.
Save tlync/0b66846a6a16794a6313 to your computer and use it in GitHub Desktop.
pre-push kuso edition
#!/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
@tlync
Copy link
Author

tlync commented Oct 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment