From 86efb3b12140e1411360bd6599e0ca1cb7f501f4 Mon Sep 17 00:00:00 2001 From: Simon Hoellein Date: Tue, 17 Sep 2024 12:12:16 +0200 Subject: [PATCH] fix(githooks): Replace [[ ... ]] to make it POSIX-compliant and compatible with /bin/sh --- .githooks/commit-msg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.githooks/commit-msg b/.githooks/commit-msg index fb7febbc5..52662a806 100755 --- a/.githooks/commit-msg +++ b/.githooks/commit-msg @@ -8,8 +8,8 @@ conventional_commit_regex="^${commit_types}(\([a-z \-]+\))?!?: .+$" commit_message=$(cat "$1") -if [[ "$commit_message" =~ $conventional_commit_regex ]]; then - echo -e "Commit message meets Conventional Commit standards..." +if echo "$commit_message" | grep -Eq "$conventional_commit_regex"; then + echo "Commit message meets Conventional Commit standards..." exit 0 fi echo