File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ regex=" ^(feat|fix|build|chore|ci|docs|style|refactor|perf|test)(\[.+\])?: .+"
4
+
5
+ grep -E " $regex " " $1 "
6
+ if [ $? != 0 ]
7
+ then
8
+ echo " [error] Commit message doesn't appear to in the conventional commit format"
9
+ echo " [info] expecting \" <type>[optional scope]: <description>\" "
10
+ echo " [info] see https://www.conventionalcommits.org/en/v1.0.0/#summary for more info"
11
+ echo " [debug] using regex: \" $regex \" "
12
+ echo " [debug] on commit message:"
13
+ cat " $1 "
14
+ exit 1
15
+ fi
Original file line number Diff line number Diff line change
1
+ @ echo off
2
+ @ REM Expected to be run from the scripts folder
3
+
4
+ copy commit-msg ..\.git\hooks\
5
+
6
+ if %ERRORLEVEL% NEQ 0 echo [error] The copy seems to have failed. This script expects to be run from inside the scripts folder
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # Expected to be run from the scripts folder
4
+
5
+ cp commit-msg ../.git/hooks/
6
+
7
+ if [ $? != 0 ]
8
+ then
9
+ echo " [error] The copy seems to have failed. This script expects to be run from inside the scripts folder"
10
+ exit 1
11
+ fi
You can’t perform that action at this time.
0 commit comments