chore(git): add commit validation git hook
This commit is contained in:
21
.githooks/commit-msg
Executable file
21
.githooks/commit-msg
Executable file
@ -0,0 +1,21 @@
|
||||
#!/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 $@
|
Reference in New Issue
Block a user