Skip to content

Commit 58459fc

Browse files
author
Anis
authored
Merge pull request #14 from lumapps/fix/pre_commit/remove_comments
fix(pre_commit): fix broken parts issue
2 parents 2b192f3 + e7785d6 commit 58459fc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

check_message.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ then
3131
exit
3232
fi
3333

34-
MESSAGE=$(<"$1")
34+
# removing comment lines from message
35+
MESSAGE=$(sed '/^#/d' "$1")
3536

3637
FIRST_WORD=${MESSAGE%% *}
3738
if [[ "${FIRST_WORD,,}" == merge ]]
@@ -44,6 +45,6 @@ fi
4445
# print message so you don't lose it in case of errors
4546
# (in case you are not using `-m` option)
4647
echo "Options: JIRA=$COMMIT_VALIDATOR_NO_JIRA, TEMP=$COMMIT_VALIDATOR_ALLOW_TEMP"
47-
printf "checking commit message:\n\n#BEGIN#\n%s\n#END#\n\n" "$(grep -v "#" <<< "$MESSAGE")"
48+
printf "checking commit message:\n\n#BEGIN#\n%s\n#END#\n\n" "$MESSAGE"
4849

4950
validate "$MESSAGE"

0 commit comments

Comments
 (0)