From b4f0a08e5e53eb9e3efae427299b71ec4b9516d2 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 04:40:20 +0000 Subject: [PATCH 1/2] feat: Updated scripts/githooks/pre-commit.sh --- scripts/githooks/pre-commit.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/githooks/pre-commit.sh b/scripts/githooks/pre-commit.sh index 24a5109c..60328249 100644 --- a/scripts/githooks/pre-commit.sh +++ b/scripts/githooks/pre-commit.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -chmod +x scripts/githooks/pre-commit.sh +chmod +x ./scripts/githooks/pre-commit.sh scripts/githooks/pre-commit.sh #!/usr/bin/env bash chmod +x scripts/githooks/pre-commit.sh @@ -69,7 +69,9 @@ function file_too_large(){ filename=$file filesize=$(( $1 / 2**20 )) - filesize=$(( $1 \/ 2**20 ))\ncat < Date: Tue, 16 Jan 2024 04:41:11 +0000 Subject: [PATCH 2/2] feat: Updated scripts/githooks/pre-push.sh --- scripts/githooks/pre-push.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/githooks/pre-push.sh b/scripts/githooks/pre-push.sh index 5eb02ffa..5e656ca9 100644 --- a/scripts/githooks/pre-push.sh +++ b/scripts/githooks/pre-push.sh @@ -99,7 +99,7 @@ print_color "Added Files: ${added_files}" "${BACKGROUND_GREEN}" print_color "Modified Files: ${modified_files}" "${BACKGROUND_GREEN}" print_color "Deleted Files: ${deleted_files}" "${BACKGROUND_GREEN}" -if [[ ! $local_branch =~ $valid_branch_regex ]] +if [[ ! "$local_branch" =~ "$valid_branch_regex" ]]; then printError "There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. Your commit will be rejected. You should rename your branch to a valid name(feat/name OR fix/name) and try again." @@ -112,7 +112,7 @@ fi #printMessage "Running the Flutter analyzer" #flutter analyze # -#if [ $? -ne 0 ]; then +#if [[ $? -ne 0 ]]; then # printError "Flutter analyzer error" # exit 1 #fi