Skip to content

Commit 9cc175f

Browse files
authored
Merge pull request #44 from jbsil/card_style_case_insensitive
automatic style detection should be case insensitive
2 parents d13f9aa + 571f69a commit 9cc175f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ fi
5454
# default (gray) by default
5555
# look for pass/fail/error in the title
5656
style=$(evaluate "$(jq -r '.params.style // "default"' < "${payload}")")
57-
[[ "${title}" =~ (pass|succeed|success) ]] && style="good"
58-
[[ "${title}" =~ (fail) ]] && style="attention"
59-
[[ "${title}" =~ (error) ]] && style="warning"
57+
[[ "${title,,}" =~ (pass|succeed|success) ]] && style="good"
58+
[[ "${title,,}" =~ (fail) ]] && style="attention"
59+
[[ "${title,,}" =~ (error) ]] && style="warning"
6060
# or in the text_output if we didn't find it in the title
61-
[[ "${style}" == "default" ]] && [[ "${text_output}" =~ (pass|succeed|success) ]] && style="good"
62-
[[ "${style}" == "default" ]] && [[ "${text_output}" =~ (fail) ]] && style="attention"
63-
[[ "${style}" == "default" ]] && [[ "${text_output}" =~ (error) ]] && style="warning"
61+
[[ "${style}" == "default" ]] && [[ "${text_output,,}" =~ (pass|succeed|success) ]] && style="good"
62+
[[ "${style}" == "default" ]] && [[ "${text_output,,}" =~ (fail) ]] && style="attention"
63+
[[ "${style}" == "default" ]] && [[ "${text_output,,}" =~ (error) ]] && style="warning"
6464

6565
DIR="${BASH_SOURCE%/*}"
6666
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi

0 commit comments

Comments
 (0)