summaryrefslogtreecommitdiff
path: root/Omni/Ide/hooks/commit-msg
blob: d77ec8400a3558c3f4a0204b355dd1b82e88a16b (plain)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env bash
temp=$(mktemp)
fmt -w 72 -s "$1" > "$temp"
mv "$temp" "$1"
if ! gitlint --ignore-stdin --staged --msg-filename "$1" run-hook; then
  backup="$CODEROOT"/.git/COMMIT_EDITMSG.backup
  cp "$1" "$backup"
  echo "error:  gitlint failed, saved your commit msg as $backup"
  exit 1
fi