Add message to GUI clients.

This commit is contained in:
Peter Fabian 2020-07-14 12:53:22 +02:00
parent 8c25557bf5
commit 74c320575d
1 changed files with 5 additions and 0 deletions

View File

@ -5,6 +5,11 @@ REMOTE_REF=$(echo "$HUSKY_GIT_STDIN" | cut -d " " -f 3)
if [ -n "$REMOTE_REF" ]; then
if [ "refs/heads/${PROTECTED_BRANCH}" == "$REMOTE_REF" ]; then
if [ "$TERM" == "dumb" ]; then
>&2 echo "Sorry, you are unable to push to master using a GUI client! Please use git CLI."
exit 1
fi
printf "%sYou're about to push to master, is that what you intended? [y/N]: %s" "$(tput setaf 3)" "$(tput sgr0)"
read -r PROCEED < /dev/tty
echo