guesstimate/.githooks/commit-msg

21 lines
444 B
Plaintext
Raw Normal View History

#!/bin/bash
set -eo pipefail
DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"
CLIENT_DIR="${DIR}/../client"
export NODE_PATH="${CLIENT_DIR}/node_modules"
export PATH="${PATH}:${NODE_PATH}/.bin"
function lint_commit_message {
local commit_message_file="$1"
( cat "$commit_message_file" | commitlint )
}
function main {
local commit_message_file="$1"
lint_commit_message "$commit_message_file"
}
main $@