File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33# list of Conventional Commits types
4- cc_types=" feat fix"
5- default_types=" build chore ci docs $ cc_types perf refactor revert style test"
6- types=( $ cc_types )
4+ cc_types=( " feat" " fix" )
5+ default_types=( " build" " chore" " ci " " docs" " ${ cc_types[@]} " " perf" " refactor" " revert" " style" " test" )
6+ types=( " ${ cc_types[@]} " )
77
88if [ $# -eq 1 ]; then
9- types=( $ default_types )
9+ types=( " ${ default_types[@]} " )
1010else
1111 # assume all args but the last are types
1212 while [ $# -gt 1 ]; do
13- types+=( $1 )
13+ types+=( " $1 " )
1414 shift
1515 done
1616fi
1717
1818# the commit message file is the last remaining arg
19- msg_file=$1
19+ msg_file=" $1 "
2020
2121# join types with | to form regex ORs
2222r_types=" ($( IFS=' |' ; echo " ${types[*]} " ) )"
@@ -34,7 +34,7 @@ if grep -Eq "$pattern" "$msg_file"; then
3434 exit 0
3535fi
3636
37- echo " [Commit message] $( cat $msg_file ) "
37+ echo " [Commit message] $( cat " $msg_file " ) "
3838echo "
3939Your commit message does not follow Conventional Commits formatting
4040https://www.conventionalcommits.org/
You can’t perform that action at this time.
0 commit comments