Files
Dhruv Atreja 22d26a3927 first commit
2024-09-13 20:56:23 +05:30

14 lines
569 B
Bash
Executable File

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Only run commitizen if no commit message was already provided: https://github.com/commitizen/cz-cli/issues/844#issuecomment-1035862033
if [ -z "${2-}" ]; then
export CZ_TYPE="${CZ_TYPE:-fix}"
export CZ_MAX_HEADER_WIDTH=$COMMITLINT_MAX_WIDTH
export CZ_MAX_LINE_WIDTH=$CZ_MAX_HEADER_WIDTH
# By default git hooks are not interactive. exec < /dev/tty allows a users terminal to interact with commitizen.
exec < /dev/tty && npx cz --hook && npx devmoji -e || true
else
npx devmoji -e || true
fi