Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions scripts/pre-commit.hook
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,21 @@ if [ $? -ne 0 ]; then
echo
fi

if [ ${RETURN} -ne 0 ]; then
if tty >/dev/null 2>&1; then
TTY=$(tty)
else
TTY=/dev/tty
fi

echo -en "Some checks fail on your source code.\nIf you insist to commit, you might face angry reviewers.\nProceed anyway? [N/y/?] "
# Read the answer
read REPLY < "$TTY"

case "$REPLY" in
Y*|y*) RETURN=0 ;;
*) ;; # fall to fail
esac
fi

exit $RETURN