Skip to content

Commit 5cefbd5

Browse files
committed
build(git): Added a git hook to check commit message.
1 parent 27060e4 commit 5cefbd5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.githooks/commit-msg.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
gommit check message "$(cat "$1")"

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,16 @@ install-tools-mac: install-tools-go
8686
install-hooks:
8787
@ $(ECHO) " "
8888
@ $(ECHO) "\033[1;33m=====> Installing Git hooks...\033[0m"
89+
cp -vf .githooks/commit-msg.sh .git/hooks/commit-msg
90+
chmod +x .git/hooks/*
8991
pre-commit install
9092

9193
@ $(ECHO) " "
9294
@ $(ECHO) "\033[1;33mLearn more about `pre-commit` at:\033[0m"
93-
@ $(ECHO) "\033[1;33m https://pre-commit.com/\033[0m"
95+
@ $(ECHO) "\033[1;33m https://pre-commit.com\033[0m"
96+
@ $(ECHO) " "
97+
@ $(ECHO) "\033[1;33mLearn more about `gommit` at:\033[0m"
98+
@ $(ECHO) "\033[1;33m https://github.com/antham/gommit\033[0m"
9499
@ $(ECHO) " "
95100

96101
#-------------------------------------------------------------------------------

0 commit comments

Comments
 (0)