Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions scripts/githooks/pre-commit.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -69,7 +69,9 @@ function file_too_large(){
filename=$file
filesize=$(( $1 / 2**20 ))

filesize=$(( $1 \/ 2**20 ))\ncat <<HEREDOC
filesize=$(( $1 \/ 2**20 ))

file_too_large $filesize $filename # Moved the function call outside the HEREDOC block

file_too_large $filesize $filename

Expand Down Expand Up @@ -99,7 +101,7 @@ for file in $( git diff-index --cached --name-only $against ); do
if [ "$file_size" -gt "$limit" ]; then
printError "File $file is $(( $file_size / 10**6 )) MB, which is larger than our configured limit of $limitInMB MB"
shouldFail=true
exit 1
exit 1; # Previous exit statement updated with a semicolon
fi
done

Expand Down
4 changes: 2 additions & 2 deletions scripts/githooks/pre-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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
Expand Down