Skip to content

Commit 86bf7af

Browse files
authored
Merge pull request #25 from tommarshall/17-fix-non-interactive-usage
Fix non-interactive usage
2 parents 0b95295 + 01a8182 commit 86bf7af

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hook.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ while true; do
284284

285285
display_warnings
286286

287+
# if non-interactive don't prompt and exit with an error
288+
if [ ! -t 1 ] && [ -z ${FAKE_TTY+x} ]; then
289+
exit 1
290+
fi
291+
287292
# Ask the question (not using "read -p" as it uses stderr not stdout)
288293
echo -en "${BLUE}Proceed with commit? [e/y/n/?] ${NC}"
289294

0 commit comments

Comments
 (0)