From ea7fde4b38234128920de116609ad05e367bf9dd Mon Sep 17 00:00:00 2001 From: enes Date: Tue, 6 Aug 2024 16:14:48 +0200 Subject: [PATCH] fix(ci): fix hook colors --- .git-hooks/commit-msg | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.git-hooks/commit-msg b/.git-hooks/commit-msg index d12ec2f..c4c6ce6 100644 --- a/.git-hooks/commit-msg +++ b/.git-hooks/commit-msg @@ -1,17 +1,18 @@ #!/bin/sh -RED="\033[1;31m" -GREEN="\033[1;32m" - # Get the commit message (the parameter we're given is just the path to the # temporary file which holds the message). commit_message=$(cat "$1") if (echo "$commit_message" | grep -Eq "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z0-9 \-]+\))?!?: .+$") then - echo "${GREEN} ✔ Commit message meets Conventional Commit standards" + tput setaf 2; + echo -e "${GREEN} ✔ Commit message meets Conventional Commit standards" + tput sgr0; exit 0 fi -echo "${RED}❌ Commit message does not meet the Conventional Commit standard!" +tput setaf 1; +echo -e "${RED}❌ Commit message does not meet the Conventional Commit standard!" +tput sgr0; echo "An example of a valid message is:" echo " feat(login): add the 'remember me' button" echo "ℹ More details at: https://www.conventionalcommits.org/en/v1.0.0/#summary"