From 80b7842a9ac34222be7cceb8ed9356e950f70ac6 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 04:16:22 +0000 Subject: [PATCH] feat: Updated scripts/githooks/commit-msg --- scripts/githooks/commit-msg | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/githooks/commit-msg b/scripts/githooks/commit-msg index bc76a56..ef59a41 100644 --- a/scripts/githooks/commit-msg +++ b/scripts/githooks/commit-msg @@ -53,7 +53,10 @@ GITLINT_DIR="./_output/tools/go-gitlint" if ! command -v $GITLINT_DIR &>/dev/null; then echo "$GITLINT_DIR not found. Attempting to install it..." - # Add the commands to download and install the go-gitlint tool here + wget -q -O go-gitlint https://example.com/go-gitlint && chmod +x go-gitlint + mv go-gitlint $GITLINT_DIR + INSTALL_STATUS=$? + if [ $INSTALL_STATUS -ne 0 ]; then if [ $? -ne 0 ]; then printError "Failed to install $GITLINT_DIR. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it manually." exit 1 @@ -73,6 +76,13 @@ then if ! command -v $GITLINT_DIR &>/dev/null; then printError "$GITLINT_DIR not found. Installing the go-gitlint tool..." make tools + $GITLINT_DIR --version + if [ $? -eq 0 ]; then + printSuccess "go-gitlint tool has been installed correctly." + else + printError "Failed to run go-gitlint tool. Please check the installation." + exit 1 + fi printError "Please make sure the installation was successful and re-run the commit-msg hook." fi printError "Please fix your commit message to match kubecub coding standards"