golint precommit: Assume the shell is non-interactive when grabbing tty failed.

This commit is contained in:
Michael Berlin 2015-08-05 15:41:00 -07:00
Родитель 90a372642c
Коммит 16e920a949
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -35,11 +35,10 @@ done
[ -z "$errors" ] && exit 0
if [[ $- == *i* ]]; then
# git doesn't give us access to user input, so let's steal it.
exec < /dev/tty
if [[ $? -eq 0 ]]; then
# interactive shell. Prompt the user.
# git doesn't give us access to user input, so let's steal it.
exec < /dev/tty
echo
echo "Lint suggestions were found. They're not enforced, but we're pausing"
echo "to let you know before they get clobbered in the scrollback buffer."