Skip to content

Instantly share code, notes, and snippets.

@lejeunerenard
Created August 19, 2016 17:59
Show Gist options
  • Save lejeunerenard/4e98328149416314250a805a588adc85 to your computer and use it in GitHub Desktop.
Save lejeunerenard/4e98328149416314250a805a588adc85 to your computer and use it in GitHub Desktop.
Prompt Check pre-commit hook
#!/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