Skip to content

Commit 308eef4

Browse files
committed
build(git): update commit-msg hook to work on macos
1 parent 79d35f2 commit 308eef4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.dev/githooks/commit-msg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
2-
shopt -s lastpipe
2+
# shopt -s lastpipe
33

44
scopes_file=".dev/scopes.txt"
5-
test -r $scopes_file &&
6-
scopes="($(cat "$scopes_file" | sed '/^\(#.*\|\)$/d' | sed ':a;N;s/\n/|/g;ta'))"
5+
test -r "$scopes_file" &&
6+
scopes="($(grep -vE '^\s*(#|$)' "$scopes_file" | paste -sd '|' - ))"
77

88
head -1 "$1" | grep -Eq "^(fix|feat|enhance|docs|style|refactor|test|build|rework|release|revert)(\(${scopes:-.*}(/.+)?\))?: [A-Za-z]"
99
result=$?

0 commit comments

Comments
 (0)