#!/usr/bin/env bash if ! gitlint --ignore-stdin --staged --msg-filename "$1" run-hook; then backup="$CODEROOT"/.git/COMMIT_EDITMSG.backup cp "$CODEROOT"/.git/COMMIT_EDITMSG "$backup" echo "error: gitlint failed, saved your commit msg as $backup" exit 1 fi