#!/bin/sh
### gitlint commit-msg hook start ###
# Determine whether we have a tty available by trying to access it.
# This allows us to deal with UI based gitclient's like Atlassian SourceTree.
# NOTE: "exec < /dev/tty" sets stdin to the keyboard
stdin_available=1
() ||
if [; then
# Now that we know we have a functional tty, set stdin to it so we can ask the user questions :-)
# On Windows, we need to explicitly set our stdout to the tty to make terminal editing work (e.g. vim)
# See SO for windows detection in bash (slight modified to work on plain shell (not bash)):
# https://stackoverflow.com/questions/394230/how-to-detect-the-os-from-a-bash-script
if [ || [ || [; then
fi
fi
exit_code=
# If we fail to find the gitlint binary (command not found), let's retry by executing as a python module.
# This is the case for Atlassian SourceTree, where $PATH deviates from the user's shell $PATH.
if [; then
exit_code=
fi
### gitlint commit-msg hook end ###