Last active
March 16, 2018 13:57
-
-
Save tobyS/64bcb6c88812f17661428b0c8ac7787a to your computer and use it in GitHub Desktop.
Asking the developer if he ran the tests before pushing
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 | |
# Allows us to read user input below, assigns stdin to keyboard | |
exec < /dev/tty | |
while true; do | |
read -p "[Pre-Push] Did you run the tests? (Y/n) " yn | |
if [ "$yn" = "" ]; then | |
yn='Y' | |
fi | |
case $yn in | |
[Yy] ) echo "[Pre-Push] Great, then we'll push now ..."; exit;; | |
[Nn] ) echo "[Pre-Push] Sorry, then please do it!"; exit 1;; | |
* ) echo "Please answer y or n for yes or no.";; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment