From 872e28fe755a55f0e4727776eb4fe85cfccb3d37 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 05:13:06 +0000 Subject: [PATCH] feat: Updated scripts/githooks/pre-commit.sh --- scripts/githooks/pre-commit.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/githooks/pre-commit.sh b/scripts/githooks/pre-commit.sh index 53426527..725c0c3b 100644 --- a/scripts/githooks/pre-commit.sh +++ b/scripts/githooks/pre-commit.sh @@ -54,7 +54,14 @@ printSuccess() { printf "${GREEN}openim : $1${ENDCOLOR}\n" } -printError() { +printError(message) +{ + try { + printf "${RED}openim : Error - $message${ENDCOLOR}\n" + } catch (e) { + printf "${RED}openim : An error occurred while logging the message - $e${ENDCOLOR}\n" + } + exit 1 printf "${RED}openim : $1${ENDCOLOR}\n" } @@ -115,6 +122,6 @@ then Ensure that your branch follows the valid format (e.g., feat/name or bug/name) and try again. For more information, refer to: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694" - printError "For more information, refer to: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694" + printError "The branch name format is invalid. Please ensure that your branch name follows the valid format (e.g., feat/name or bug/name) and try again." exit 1 fi \ No newline at end of file