Created
August 19, 2016 17:59
-
-
Save lejeunerenard/4e98328149416314250a805a588adc85 to your computer and use it in GitHub Desktop.
Prompt Check pre-commit hook
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/bash | |
# Allow keyboard input | |
exec < /dev/tty | |
while : | |
do | |
echo -n "Are you sure? (Y/n): " | |
read x | |
case $x in | |
"y"|"Y"|"" ) | |
exit | |
break | |
;; | |
"n"|"N" ) | |
echo "Aborting..." | |
exit 1 | |
break | |
;; | |
* ) | |
echo "Please enter either 'y' or 'n'" | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment