From 3d9ac391d1a87f4638eddaae2e8b3fcf3b99c182 Mon Sep 17 00:00:00 2001 From: Rodrigo Motta Date: Sun, 1 Feb 2026 15:15:39 -0300 Subject: [PATCH 1/7] fix(src): local variable 'REPO' updated to lower_case naming convention. --- src/bitbucket/bb-pr-create.sh | 10 +++++----- src/bitbucket/bb-pr-merge.sh | 10 +++++----- src/bitbucket/bb-pr-update.sh | 12 ++++++------ src/bitbucket/bb-repo-create.sh | 10 +++++----- src/bitbucket/bb-repo-delete.sh | 12 ++++++------ src/bitbucket/bb-repo-edit.sh | 10 +++++----- src/github/gh-pr-create.sh | 10 +++++----- src/github/gh-pr-merge.sh | 10 +++++----- src/github/gh-pr-update.sh | 12 ++++++------ src/github/gh-repo-create.sh | 10 +++++----- src/github/gh-repo-delete.sh | 12 ++++++------ src/github/gh-repo-edit.sh | 10 +++++----- src/gitlab/gl-pr-create.sh | 10 +++++----- src/gitlab/gl-pr-merge.sh | 10 +++++----- src/gitlab/gl-pr-update.sh | 10 +++++----- src/gitlab/gl-repo-create.sh | 10 +++++----- src/gitlab/gl-repo-delete.sh | 12 ++++++------ src/gitlab/gl-repo-edit.sh | 10 +++++----- src/gitnap/gn-init-git.sh | 6 +++--- 19 files changed, 98 insertions(+), 98 deletions(-) diff --git a/src/bitbucket/bb-pr-create.sh b/src/bitbucket/bb-pr-create.sh index 2eec3b5..56a614b 100755 --- a/src/bitbucket/bb-pr-create.sh +++ b/src/bitbucket/bb-pr-create.sh @@ -9,7 +9,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function create_bitbucket_pullrequest() { - local REPO + local repo local WORKSPACE local pr_title local pr_body @@ -20,11 +20,11 @@ function create_bitbucket_pullrequest() { local response # Name of repository - REPO="$1" + repo="$1" # Checks if the parameter was provided or use the name of the current directory - if [[ -z "$REPO" ]]; then - REPO=$(basename "$PWD") + if [[ -z "$repo" ]]; then + repo=$(basename "$PWD") fi # Name of workspace @@ -53,7 +53,7 @@ function create_bitbucket_pullrequest() { } } }' # Construct URL endpoint - endpoint="$(build_bb_endpoint "PR" "$WORKSPACE" "$REPO")" + endpoint="$(build_bb_endpoint "PR" "$WORKSPACE" "$repo")" # Create the repository using curl response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X POST "$endpoint" \ diff --git a/src/bitbucket/bb-pr-merge.sh b/src/bitbucket/bb-pr-merge.sh index a6fa2a1..58a89f5 100755 --- a/src/bitbucket/bb-pr-merge.sh +++ b/src/bitbucket/bb-pr-merge.sh @@ -10,7 +10,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function create_bitbucket_pullrequest() { local pr - local REPO + local repo local WORKSPACE local payload local pr_endpoint @@ -27,12 +27,12 @@ function create_bitbucket_pullrequest() { fi # Name of repository - REPO="$2" + repo="$2" # Verifica se o parâmetro foi fornecido - if [[ -z "$REPO" ]]; then + if [[ -z "$repo" ]]; then # Se não foi fornecido, utiliza o nome do diretório atual - REPO=$(basename "$PWD") + repo=$(basename "$PWD") fi # Repo owner @@ -53,7 +53,7 @@ function create_bitbucket_pullrequest() { }' # Construct URL endpoint - pr_endpoint="$(build_bb_endpoint "PR" "$WORKSPACE" "$REPO")" + pr_endpoint="$(build_bb_endpoint "PR" "$WORKSPACE" "$repo")" endpoint="$endpoint/$pr/merge" # Create the repository using curl diff --git a/src/bitbucket/bb-pr-update.sh b/src/bitbucket/bb-pr-update.sh index 32b9f16..a423377 100755 --- a/src/bitbucket/bb-pr-update.sh +++ b/src/bitbucket/bb-pr-update.sh @@ -10,7 +10,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function update_bitbucket_pullrequest() { local pr - local REPO + local repo local PROJECT local up_pr_title local up_pr_body @@ -30,12 +30,12 @@ function update_bitbucket_pullrequest() { fi # Name of repository - REPO="$2" + repo="$2" # Verifica se o parâmetro foi fornecido - if [[ -z "$REPO" ]]; then + if [[ -z "$repo" ]]; then # Se não foi fornecido, utiliza o nome do diretório atual - REPO=$(basename "$PWD") + repo=$(basename "$PWD") fi # Repo owner @@ -62,9 +62,9 @@ function update_bitbucket_pullrequest() { } } }' # Construct URL endpoint - #endpoint_url="$API_URL/projects/$PROJECT/repos/$REPO/pull-requests/$pr" + #endpoint_url="$API_URL/projects/$PROJECT/repos/$repo/pull-requests/$pr" - pr_endpoint="$(build_bb_endpoint "PR" "$WORKSPACE" "$REPO")" + pr_endpoint="$(build_bb_endpoint "PR" "$WORKSPACE" "$repo")" endpoint="$pr_endpoint/$pr" # Create the repository using curl diff --git a/src/bitbucket/bb-repo-create.sh b/src/bitbucket/bb-repo-create.sh index 8db1b45..3dd09d3 100755 --- a/src/bitbucket/bb-repo-create.sh +++ b/src/bitbucket/bb-repo-create.sh @@ -7,7 +7,7 @@ BITBUCKET_AUTH="Authorization: Basic $(echo -n "$BITBUCKET_USER:$BITBUCKET_APPWD function create_bitbucket_repo() { - local REPO + local repo local WORKSPACE local PROJECT local payload @@ -15,11 +15,11 @@ function create_bitbucket_repo() { local response # Name of repository - REPO="$1" + repo="$1" # Checks if the parameter was provided or use the name of the current directory - if [[ -z "$REPO" ]]; then - REPO=$(basename "$PWD") + if [[ -z "$repo" ]]; then + repo=$(basename "$PWD") fi # Name of project @@ -45,7 +45,7 @@ function create_bitbucket_repo() { }}' # Construct the API Endpoint - endpoint="https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$REPO" + endpoint="https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$repo" # Create Bitbucket repository response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X POST "$endpoint" \ diff --git a/src/bitbucket/bb-repo-delete.sh b/src/bitbucket/bb-repo-delete.sh index b924953..58ae453 100755 --- a/src/bitbucket/bb-repo-delete.sh +++ b/src/bitbucket/bb-repo-delete.sh @@ -7,17 +7,17 @@ BITBUCKET_AUTH="Authorization: Basic $(echo -n "$BITBUCKET_USER:$BITBUCKET_APPWD function delete_bitbucket_repo() { - local REPO + local repo local WORKSPACE local endpoint local response # Name of repository - REPO="$1" + repo="$1" # Checks if the parameter was provided or use the name of the current directory - if [[ -z "$REPO" ]]; then - REPO=$(basename "$PWD") + if [[ -z "$repo" ]]; then + repo=$(basename "$PWD") fi # Name of workspace @@ -29,10 +29,10 @@ function delete_bitbucket_repo() { fi # Construct API Endpoint - endpoint="https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$REPO" + endpoint="https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$repo" # Confirm deletion before proceeding - echo "Are you sure you want to delete the repository '$REPO' (y/N)?" + echo "Are you sure you want to delete the repository '$repo' (y/N)?" read -r confirmation if [[ $confirmation =~ ^[Yy]$ ]]; then diff --git a/src/bitbucket/bb-repo-edit.sh b/src/bitbucket/bb-repo-edit.sh index 07b26e7..b44d80b 100755 --- a/src/bitbucket/bb-repo-edit.sh +++ b/src/bitbucket/bb-repo-edit.sh @@ -7,7 +7,7 @@ BITBUCKET_AUTH="Authorization: Basic $(echo -n "$BITBUCKET_USER:$BITBUCKET_APPWD function edit_bitbucket_repo() { - local REPO + local repo local WORKSPACE local new_description local payload @@ -24,11 +24,11 @@ function edit_bitbucket_repo() { fi # Name of repository - REPO="$2" + repo="$2" # Checks if the parameter was provided or use the name of the current directory - if [[ -z "$REPO" ]]; then - REPO=$(basename "$PWD") + if [[ -z "$repo" ]]; then + repo=$(basename "$PWD") fi # Name of workspace @@ -43,7 +43,7 @@ function edit_bitbucket_repo() { payload='{"description": "'"$new_description"'"}' # Construct API Endpoint - endpoint="https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$REPO" + endpoint="https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$repo" # Edit Bitbucket repository response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X PUT "$endpoint" \ diff --git a/src/github/gh-pr-create.sh b/src/github/gh-pr-create.sh index 2a29d21..42d5dda 100755 --- a/src/github/gh-pr-create.sh +++ b/src/github/gh-pr-create.sh @@ -9,7 +9,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function create_github_pullrequest() { - local REPO + local repo local OWNER local pr_title local pr_body @@ -20,11 +20,11 @@ function create_github_pullrequest() { local response # Name of repository - REPO="$1" + repo="$1" # Checks if the parameter was provided or use the name of the current directory - if [[ -z "$REPO" ]]; then - REPO=$(basename "$PWD") + if [[ -z "$repo" ]]; then + repo=$(basename "$PWD") fi # Repo owner @@ -46,7 +46,7 @@ function create_github_pullrequest() { "head":"'"$source_branch"'","base":"'"$target_branch"'"}' # Construct URL endpoint - endpoint="$(build_gh_endpoint "PR" "$OWNER" "$REPO")" + endpoint="$(build_gh_endpoint "PR" "$OWNER" "$repo")" # Create the repository using curl response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X POST "$endpoint" \ diff --git a/src/github/gh-pr-merge.sh b/src/github/gh-pr-merge.sh index 2a84292..3e3ddb5 100755 --- a/src/github/gh-pr-merge.sh +++ b/src/github/gh-pr-merge.sh @@ -10,7 +10,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function merge_github_pullrequest() { local pr - local REPO + local repo local OWNER local pr_title local pr_body @@ -30,12 +30,12 @@ function merge_github_pullrequest() { fi # Name of repository - REPO="$2" + repo="$2" # Verifica se o parâmetro foi fornecido - if [[ -z "$REPO" ]]; then + if [[ -z "$repo" ]]; then # Se não foi fornecido, utiliza o nome do diretório atual - REPO=$(basename "$PWD") + repo=$(basename "$PWD") fi # Repo owner @@ -51,7 +51,7 @@ function merge_github_pullrequest() { payload='{"merge_method":"squash"}' # Construct URL endpoint - pr_endpoint="$(build_gh_endpoint "PR" "$OWNER" "$REPO")" + pr_endpoint="$(build_gh_endpoint "PR" "$OWNER" "$repo")" endpoint="$pr_endpoint/$pr/merge" # Create the repository using curl diff --git a/src/github/gh-pr-update.sh b/src/github/gh-pr-update.sh index 59299bc..4b4d3d7 100755 --- a/src/github/gh-pr-update.sh +++ b/src/github/gh-pr-update.sh @@ -10,7 +10,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function update_github_pullrequest() { local pr - local REPO + local repo local OWNER local up_pr_title local up_pr_body @@ -30,12 +30,12 @@ function update_github_pullrequest() { fi # Name of repository - REPO="$2" + repo="$2" # Verifica se o parâmetro foi fornecido - if [[ -z "$REPO" ]]; then + if [[ -z "$repo" ]]; then # Se não foi fornecido, utiliza o nome do diretório atual - REPO=$(basename "$PWD") + repo=$(basename "$PWD") fi # Repo owner @@ -53,8 +53,8 @@ function update_github_pullrequest() { # Create the JSON payload for the repository payload='{"title":"'"$up_pr_title"'", "body":"'"$up_pr_body"'"}' - #pr_url="$API_URL/$OWNER/$REPO/pulls" - pr_endpoint="$(build_gh_endpoint "PR" "$OWNER" "$REPO")" + #pr_url="$API_URL/$OWNER/$repo/pulls" + pr_endpoint="$(build_gh_endpoint "PR" "$OWNER" "$repo")" endpoint="$pr_endpoint/$pr" # Create the repository using curl diff --git a/src/github/gh-repo-create.sh b/src/github/gh-repo-create.sh index f967775..712c83b 100755 --- a/src/github/gh-repo-create.sh +++ b/src/github/gh-repo-create.sh @@ -3,21 +3,21 @@ set -euo pipefail function create_github_repo() { - local REPO + local repo local payload local endpoint local response # Name of repository - REPO="$1" + repo="$1" # Checks if the parameter was provided or use the name of the current directory - if [[ -z "$REPO" ]]; then - REPO=$(basename "$PWD") + if [[ -z "$repo" ]]; then + repo=$(basename "$PWD") fi # Create the JSON payload for the repository - payload='{"name": "'"$REPO"'", "private": true}' + payload='{"name": "'"$repo"'", "private": true}' # API Endpoint endpoint="https://api.github.com/user/repos" diff --git a/src/github/gh-repo-delete.sh b/src/github/gh-repo-delete.sh index ad7c455..5ce854e 100755 --- a/src/github/gh-repo-delete.sh +++ b/src/github/gh-repo-delete.sh @@ -3,17 +3,17 @@ set -euo pipefail function delete_github_repo() { - local REPO + local repo local OWNER local endpoint local response # Name of repository - REPO="$1" + repo="$1" # Checks if the parameter was provided or use the name of the current directory - if [[ -z "$REPO" ]]; then - REPO=$(basename "$PWD") + if [[ -z "$repo" ]]; then + repo=$(basename "$PWD") fi # Repo owner @@ -25,10 +25,10 @@ function delete_github_repo() { fi # Construct API Endpoint - endpoint="https://api.github.com/repos/$OWNER/$REPO" + endpoint="https://api.github.com/repos/$OWNER/$repo" # Confirm deletion before proceeding - echo "Are you sure you want to delete the repository '$REPO' (y/N)?" + echo "Are you sure you want to delete the repository '$repo' (y/N)?" read -r confirmation if [[ $confirmation =~ ^[Yy]$ ]]; then diff --git a/src/github/gh-repo-edit.sh b/src/github/gh-repo-edit.sh index a427174..54d988c 100755 --- a/src/github/gh-repo-edit.sh +++ b/src/github/gh-repo-edit.sh @@ -3,7 +3,7 @@ set -euo pipefail function edit_github_repo() { - local REPO + local repo local OWNER local new_description local payload @@ -20,11 +20,11 @@ function edit_github_repo() { fi # Name of repository - REPO="$2" + repo="$2" # Checks if the parameter was provided or use the name of the current directory - if [[ -z "$REPO" ]]; then - REPO=$(basename "$PWD") + if [[ -z "$repo" ]]; then + repo=$(basename "$PWD") fi # Repo owner @@ -39,7 +39,7 @@ function edit_github_repo() { payload='{"description": "'"$new_description"'"}' # Construct API Endpoint - endpoint="https://api.github.com/repos/$OWNER/$REPO" + endpoint="https://api.github.com/repos/$OWNER/$repo" # Edit the repository using curl response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X PATCH "$endpoint" \ diff --git a/src/gitlab/gl-pr-create.sh b/src/gitlab/gl-pr-create.sh index 75e7c51..c146176 100755 --- a/src/gitlab/gl-pr-create.sh +++ b/src/gitlab/gl-pr-create.sh @@ -9,7 +9,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function create_gitlab_pullrequest() { - local REPO + local repo local OWNER local pr_title local pr_body @@ -20,12 +20,12 @@ function create_gitlab_pullrequest() { local response # Name of repository - REPO="$1" + repo="$1" # Verifica se o parâmetro foi fornecido - if [[ -z "$REPO" ]]; then + if [[ -z "$repo" ]]; then # Se não foi fornecido, utiliza o nome do diretório atual - REPO=$(basename "$PWD") + repo=$(basename "$PWD") fi # Repo owner @@ -49,7 +49,7 @@ function create_gitlab_pullrequest() { "remove_source_branch":"True", "squash":"True"}' # Construct the endpoint URL - endpoint="$(build_gl_endpoint "PR" "$OWNER" "$REPO")" + endpoint="$(build_gl_endpoint "PR" "$OWNER" "$repo")" # Create the repository using curl response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X POST "$endpoint" \ diff --git a/src/gitlab/gl-pr-merge.sh b/src/gitlab/gl-pr-merge.sh index 0687906..44cee62 100755 --- a/src/gitlab/gl-pr-merge.sh +++ b/src/gitlab/gl-pr-merge.sh @@ -10,7 +10,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function merge_gitlab_pullrequest() { local pr - local REPO + local repo local OWNER local payload local endpoint @@ -26,12 +26,12 @@ function merge_gitlab_pullrequest() { fi # Name of repository - REPO="$2" + repo="$2" # Verifica se o parâmetro foi fornecido - if [[ -z "$REPO" ]]; then + if [[ -z "$repo" ]]; then # Se não foi fornecido, utiliza o nome do diretório atual - REPO=$(basename "$PWD") + repo=$(basename "$PWD") fi # Repo owner @@ -47,7 +47,7 @@ function merge_gitlab_pullrequest() { payload='{"merge_method":"squash"}' # Construct the endpoint URL - pr_endpoint="$(build_gl_endpoint "PR" "$OWNER" "$REPO")" + pr_endpoint="$(build_gl_endpoint "PR" "$OWNER" "$repo")" endpoint="$pr_endpoint/$pr/merge" # Create the repository using curl diff --git a/src/gitlab/gl-pr-update.sh b/src/gitlab/gl-pr-update.sh index aa15869..a551960 100755 --- a/src/gitlab/gl-pr-update.sh +++ b/src/gitlab/gl-pr-update.sh @@ -10,7 +10,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function update_gitlab_pullrequest() { local pr - local REPO + local repo local OWNER local up_pr_title local up_pr_body @@ -28,12 +28,12 @@ function update_gitlab_pullrequest() { fi # Name of repository - REPO="$2" + repo="$2" # Verifica se o parâmetro foi fornecido - if [[ -z "$REPO" ]]; then + if [[ -z "$repo" ]]; then # Se não foi fornecido, utiliza o nome do diretório atual - REPO=$(basename "$PWD") + repo=$(basename "$PWD") fi # Repo owner @@ -52,7 +52,7 @@ function update_gitlab_pullrequest() { payload='{"title":"'"$pr_title"'", "body":"'"$pr_body"'"}' # Construct the endpoint URL - pr_endpoint="$(build_gl_endpoint "PR" "$OWNER" "$REPO")" + pr_endpoint="$(build_gl_endpoint "PR" "$OWNER" "$repo")" endpoint="$pr_endpoint/$pr" # Create the repository using curl diff --git a/src/gitlab/gl-repo-create.sh b/src/gitlab/gl-repo-create.sh index 85de36f..558a92c 100755 --- a/src/gitlab/gl-repo-create.sh +++ b/src/gitlab/gl-repo-create.sh @@ -3,21 +3,21 @@ set -euo pipefail function create_gitlab_repo() { - local REPO + local repo local payload local endpoint local response # Name of repository - REPO="$1" + repo="$1" # Checks if the parameter was provided or use the name of the current directory - if [[ -z "$REPO" ]]; then - REPO=$(basename "$PWD") + if [[ -z "$repo" ]]; then + repo=$(basename "$PWD") fi # Create the JSON payload for the repository - payload='{"name": "'"$REPO"'", "visibility": "private"}' + payload='{"name": "'"$repo"'", "visibility": "private"}' # Construct API Endpoint endpoint="https://gitlab.com/api/v4/projects" diff --git a/src/gitlab/gl-repo-delete.sh b/src/gitlab/gl-repo-delete.sh index f5d0dbf..54f8381 100755 --- a/src/gitlab/gl-repo-delete.sh +++ b/src/gitlab/gl-repo-delete.sh @@ -3,17 +3,17 @@ set -euo pipefail function delete_gitlab_repo() { - local REPO + local repo local OWNER local endpoint local response # Name of repository - REPO="$1" + repo="$1" # Checks if the parameter was provided or use the name of the current directory - if [[ -z "$REPO" ]]; then - REPO=$(basename "$PWD") + if [[ -z "$repo" ]]; then + repo=$(basename "$PWD") fi # Repo owner @@ -26,10 +26,10 @@ function delete_gitlab_repo() { # Construct API Endpoint SLASH_ENCODED="%2F" - endpoint="https://gitlab.com/api/v4/projects/$OWNER$SLASH_ENCODED$REPO" + endpoint="https://gitlab.com/api/v4/projects/$OWNER$SLASH_ENCODED$repo" # Confirm deletion before proceeding - echo "Are you sure you want to delete the repository '$REPO' (y/N)?" + echo "Are you sure you want to delete the repository '$repo' (y/N)?" read -r confirmation if [[ $confirmation =~ ^[Yy]$ ]]; then diff --git a/src/gitlab/gl-repo-edit.sh b/src/gitlab/gl-repo-edit.sh index c3a06e3..59ed128 100755 --- a/src/gitlab/gl-repo-edit.sh +++ b/src/gitlab/gl-repo-edit.sh @@ -3,7 +3,7 @@ set -euo pipefail function edit_gitlab_repo() { - local REPO + local repo local OWNER local new_description local payload @@ -20,11 +20,11 @@ function edit_gitlab_repo() { fi # Name of repository - REPO="$2" + repo="$2" # Checks if the parameter was provided or use the name of the current directory - if [[ -z "$REPO" ]]; then - REPO=$(basename "$PWD") + if [[ -z "$repo" ]]; then + repo=$(basename "$PWD") fi # Repo owner @@ -40,7 +40,7 @@ function edit_gitlab_repo() { # Construct API Endpoint SLASH_ENCODED="%2F" - endpoint="https://gitlab.com/api/v4/projects/$OWNER$SLASH_ENCODED$REPO" + endpoint="https://gitlab.com/api/v4/projects/$OWNER$SLASH_ENCODED$repo" # Edit GitLab repository using curl response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X PUT "$endpoint" \ diff --git a/src/gitnap/gn-init-git.sh b/src/gitnap/gn-init-git.sh index 058ba64..d53c4f4 100755 --- a/src/gitnap/gn-init-git.sh +++ b/src/gitnap/gn-init-git.sh @@ -6,17 +6,17 @@ source "$GITNAP/utils/down_license.sh" # Sets up a new Git project with optional .gitignore and license. function initialize_git_repo() { - local REPO + local repo # Get current working directory - REPO=$(basename "$PWD") + repo=$(basename "$PWD") # Initialize Git repository git init --initial-branch=main # Check for existing README.md file if [ ! -f "README.md" ]; then - echo "# $REPO" > README.md + echo "# $repo" > README.md fi git add README.md From edda8d0614509d8473886340a9f9ed4487cd0ec9 Mon Sep 17 00:00:00 2001 From: Rodrigo Motta Date: Sun, 1 Feb 2026 15:29:52 -0300 Subject: [PATCH 2/7] fix(src): local variable 'WORKSPACE' updated to lower_case naming convention. --- src/bitbucket/bb-pr-create.sh | 10 +++++----- src/bitbucket/bb-pr-merge.sh | 10 +++++----- src/bitbucket/bb-pr-update.sh | 2 +- src/bitbucket/bb-repo-create.sh | 10 +++++----- src/bitbucket/bb-repo-delete.sh | 10 +++++----- src/bitbucket/bb-repo-edit.sh | 10 +++++----- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/bitbucket/bb-pr-create.sh b/src/bitbucket/bb-pr-create.sh index 56a614b..f709969 100755 --- a/src/bitbucket/bb-pr-create.sh +++ b/src/bitbucket/bb-pr-create.sh @@ -10,7 +10,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function create_bitbucket_pullrequest() { local repo - local WORKSPACE + local workspace local pr_title local pr_body local source_branch @@ -28,11 +28,11 @@ function create_bitbucket_pullrequest() { fi # Name of workspace - WORKSPACE="$2" + workspace="$2" # Checks if the parameter was provided or use the default - if [[ -z "$WORKSPACE" ]]; then - WORKSPACE="$DEF_WORKSPACE" + if [[ -z "$workspace" ]]; then + workspace="$DEF_WORKSPACE" fi pr_title="$(format_pullrequest "title")" @@ -53,7 +53,7 @@ function create_bitbucket_pullrequest() { } } }' # Construct URL endpoint - endpoint="$(build_bb_endpoint "PR" "$WORKSPACE" "$repo")" + endpoint="$(build_bb_endpoint "PR" "$workspace" "$repo")" # Create the repository using curl response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X POST "$endpoint" \ diff --git a/src/bitbucket/bb-pr-merge.sh b/src/bitbucket/bb-pr-merge.sh index 58a89f5..8914118 100755 --- a/src/bitbucket/bb-pr-merge.sh +++ b/src/bitbucket/bb-pr-merge.sh @@ -11,7 +11,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function create_bitbucket_pullrequest() { local pr local repo - local WORKSPACE + local workspace local payload local pr_endpoint local endpoint @@ -36,12 +36,12 @@ function create_bitbucket_pullrequest() { fi # Repo owner - WORKSPACE="$3" + workspace="$3" # Verifica se o parâmetro foi fornecido - if [[ -z "$WORKSPACE" ]]; then + if [[ -z "$workspace" ]]; then # Se não foi fornecido, utiliza o padrão definido em auth.sh - WORKSPACE="$DEF_WORKSPACE" + workspace="$DEF_WORKSPACE" fi # Create the JSON payload for the repository @@ -53,7 +53,7 @@ function create_bitbucket_pullrequest() { }' # Construct URL endpoint - pr_endpoint="$(build_bb_endpoint "PR" "$WORKSPACE" "$repo")" + pr_endpoint="$(build_bb_endpoint "PR" "$workspace" "$repo")" endpoint="$endpoint/$pr/merge" # Create the repository using curl diff --git a/src/bitbucket/bb-pr-update.sh b/src/bitbucket/bb-pr-update.sh index a423377..83eb590 100755 --- a/src/bitbucket/bb-pr-update.sh +++ b/src/bitbucket/bb-pr-update.sh @@ -64,7 +64,7 @@ function update_bitbucket_pullrequest() { # Construct URL endpoint #endpoint_url="$API_URL/projects/$PROJECT/repos/$repo/pull-requests/$pr" - pr_endpoint="$(build_bb_endpoint "PR" "$WORKSPACE" "$repo")" + pr_endpoint="$(build_bb_endpoint "PR" "$workspace" "$repo")" endpoint="$pr_endpoint/$pr" # Create the repository using curl diff --git a/src/bitbucket/bb-repo-create.sh b/src/bitbucket/bb-repo-create.sh index 3dd09d3..fe892e9 100755 --- a/src/bitbucket/bb-repo-create.sh +++ b/src/bitbucket/bb-repo-create.sh @@ -8,7 +8,7 @@ BITBUCKET_AUTH="Authorization: Basic $(echo -n "$BITBUCKET_USER:$BITBUCKET_APPWD function create_bitbucket_repo() { local repo - local WORKSPACE + local workspace local PROJECT local payload local endpoint @@ -31,11 +31,11 @@ function create_bitbucket_repo() { fi # Name of workspace - WORKSPACE="$3" + workspace="$3" # Checks if the parameter was provided or use the default - if [[ -z "$WORKSPACE" ]]; then - WORKSPACE="$DEF_WORKSPACE" + if [[ -z "$workspace" ]]; then + workspace="$DEF_WORKSPACE" fi # Create the JSON payload for the repository @@ -45,7 +45,7 @@ function create_bitbucket_repo() { }}' # Construct the API Endpoint - endpoint="https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$repo" + endpoint="https://api.bitbucket.org/2.0/repositories/$workspace/$repo" # Create Bitbucket repository response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X POST "$endpoint" \ diff --git a/src/bitbucket/bb-repo-delete.sh b/src/bitbucket/bb-repo-delete.sh index 58ae453..34b6523 100755 --- a/src/bitbucket/bb-repo-delete.sh +++ b/src/bitbucket/bb-repo-delete.sh @@ -8,7 +8,7 @@ BITBUCKET_AUTH="Authorization: Basic $(echo -n "$BITBUCKET_USER:$BITBUCKET_APPWD function delete_bitbucket_repo() { local repo - local WORKSPACE + local workspace local endpoint local response @@ -21,15 +21,15 @@ function delete_bitbucket_repo() { fi # Name of workspace - WORKSPACE="$2" + workspace="$2" # Checks if the parameter was provided or use the default - if [[ -z "$WORKSPACE" ]]; then - WORKSPACE="$DEF_WORKSPACE" + if [[ -z "$workspace" ]]; then + workspace="$DEF_WORKSPACE" fi # Construct API Endpoint - endpoint="https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$repo" + endpoint="https://api.bitbucket.org/2.0/repositories/$workspace/$repo" # Confirm deletion before proceeding echo "Are you sure you want to delete the repository '$repo' (y/N)?" diff --git a/src/bitbucket/bb-repo-edit.sh b/src/bitbucket/bb-repo-edit.sh index b44d80b..9d727a3 100755 --- a/src/bitbucket/bb-repo-edit.sh +++ b/src/bitbucket/bb-repo-edit.sh @@ -8,7 +8,7 @@ BITBUCKET_AUTH="Authorization: Basic $(echo -n "$BITBUCKET_USER:$BITBUCKET_APPWD function edit_bitbucket_repo() { local repo - local WORKSPACE + local workspace local new_description local payload local endpoint @@ -32,18 +32,18 @@ function edit_bitbucket_repo() { fi # Name of workspace - WORKSPACE="$3" + workspace="$3" # Checks if the parameter was provided or use the default - if [[ -z "$WORKSPACE" ]]; then - WORKSPACE="$DEF_WORKSPACE" + if [[ -z "$workspace" ]]; then + workspace="$DEF_WORKSPACE" fi # Create the JSON payload for the repository payload='{"description": "'"$new_description"'"}' # Construct API Endpoint - endpoint="https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$repo" + endpoint="https://api.bitbucket.org/2.0/repositories/$workspace/$repo" # Edit Bitbucket repository response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X PUT "$endpoint" \ From 382a2960284394158fcc8f4c687edc46d7dc9256 Mon Sep 17 00:00:00 2001 From: Rodrigo Motta Date: Sun, 1 Feb 2026 15:35:27 -0300 Subject: [PATCH 3/7] fix(src): local variable 'PROJECT' updated to lower_case naming convention. --- src/bitbucket/bb-pr-update.sh | 10 +++++----- src/bitbucket/bb-repo-create.sh | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/bitbucket/bb-pr-update.sh b/src/bitbucket/bb-pr-update.sh index 83eb590..eac865a 100755 --- a/src/bitbucket/bb-pr-update.sh +++ b/src/bitbucket/bb-pr-update.sh @@ -11,7 +11,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function update_bitbucket_pullrequest() { local pr local repo - local PROJECT + local project local up_pr_title local up_pr_body local source_branch @@ -39,12 +39,12 @@ function update_bitbucket_pullrequest() { fi # Repo owner - PROJECT="$3" + project="$3" # Verifica se o parâmetro foi fornecido - if [[ -z "$PROJECT" ]]; then + if [[ -z "$project" ]]; then # Se não foi fornecido, utiliza o padrão definido em auth.sh - PROJECT="$DEF_PROJECT" + project="$DEF_PROJECT" fi up_pr_title="$(format_pullrequest "title")" @@ -62,7 +62,7 @@ function update_bitbucket_pullrequest() { } } }' # Construct URL endpoint - #endpoint_url="$API_URL/projects/$PROJECT/repos/$repo/pull-requests/$pr" + #endpoint_url="$API_URL/projects/$project/repos/$repo/pull-requests/$pr" pr_endpoint="$(build_bb_endpoint "PR" "$workspace" "$repo")" endpoint="$pr_endpoint/$pr" diff --git a/src/bitbucket/bb-repo-create.sh b/src/bitbucket/bb-repo-create.sh index fe892e9..a47e544 100755 --- a/src/bitbucket/bb-repo-create.sh +++ b/src/bitbucket/bb-repo-create.sh @@ -9,7 +9,7 @@ BITBUCKET_AUTH="Authorization: Basic $(echo -n "$BITBUCKET_USER:$BITBUCKET_APPWD function create_bitbucket_repo() { local repo local workspace - local PROJECT + local project local payload local endpoint local response @@ -23,11 +23,11 @@ function create_bitbucket_repo() { fi # Name of project - PROJECT="$2" + project="$2" # Checks if the parameter was provided or use the default - if [[ -z "$PROJECT" ]]; then - PROJECT="$DEF_PROJECT" + if [[ -z "$project" ]]; then + project="$DEF_PROJECT" fi # Name of workspace @@ -41,7 +41,7 @@ function create_bitbucket_repo() { # Create the JSON payload for the repository payload='{"scm": "git", "is_private": true, "project": { - "key": "'"$PROJECT"'" + "key": "'"$project"'" }}' # Construct the API Endpoint From f979d402f8350e561d2d43520c391daf74526889 Mon Sep 17 00:00:00 2001 From: Rodrigo Motta Date: Sun, 1 Feb 2026 15:38:18 -0300 Subject: [PATCH 4/7] fix(src): local variable 'NOTIFICATION_ID' updated to lower_case naming convention. --- src/github/gh-notification-delete.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/github/gh-notification-delete.sh b/src/github/gh-notification-delete.sh index 21410ff..e3e8780 100755 --- a/src/github/gh-notification-delete.sh +++ b/src/github/gh-notification-delete.sh @@ -12,21 +12,21 @@ set -euo pipefail function delete_github_notifications() { - local NOTIFICATION_ID + local notification_id local endpoint local response local tmp_file - NOTIFICATION_ID="$1" + notification_id="$1" # Checks if the parameter was provided. - if [[ -z "$NOTIFICATION_ID" ]]; then + if [[ -z "$notification_id" ]]; then echo "Provide id notification to delete" exit 1 fi # API Endpoint - endpoint="https://api.github.com/notifications/threads/$NOTIFICATION_ID" + endpoint="https://api.github.com/notifications/threads/$notification_id" # Delete notifications response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X DELETE "$endpoint" \ From 40391f7c338584524354fce396c2e6e66d52f59e Mon Sep 17 00:00:00 2001 From: Rodrigo Motta Date: Sun, 1 Feb 2026 15:45:31 -0300 Subject: [PATCH 5/7] fix(src): local variable 'OWNER' updated to lower_case naming convention. --- src/github/gh-pr-create.sh | 10 +++++----- src/github/gh-pr-merge.sh | 10 +++++----- src/github/gh-pr-update.sh | 12 ++++++------ src/github/gh-repo-delete.sh | 10 +++++----- src/github/gh-repo-edit.sh | 10 +++++----- src/gitlab/gl-pr-create.sh | 10 +++++----- src/gitlab/gl-pr-merge.sh | 10 +++++----- src/gitlab/gl-pr-update.sh | 10 +++++----- src/gitlab/gl-repo-delete.sh | 10 +++++----- src/gitlab/gl-repo-edit.sh | 10 +++++----- 10 files changed, 51 insertions(+), 51 deletions(-) diff --git a/src/github/gh-pr-create.sh b/src/github/gh-pr-create.sh index 42d5dda..71915ce 100755 --- a/src/github/gh-pr-create.sh +++ b/src/github/gh-pr-create.sh @@ -10,7 +10,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function create_github_pullrequest() { local repo - local OWNER + local owner local pr_title local pr_body local source_branch @@ -28,11 +28,11 @@ function create_github_pullrequest() { fi # Repo owner - OWNER="$2" + owner="$2" # Checks if the parameter was provided or use the default - if [[ -z "$OWNER" ]]; then - OWNER="$DEF_GH_OWNER" + if [[ -z "$owner" ]]; then + owner="$DEF_GH_OWNER" fi pr_title="$(format_pullrequest "title")" @@ -46,7 +46,7 @@ function create_github_pullrequest() { "head":"'"$source_branch"'","base":"'"$target_branch"'"}' # Construct URL endpoint - endpoint="$(build_gh_endpoint "PR" "$OWNER" "$repo")" + endpoint="$(build_gh_endpoint "PR" "$owner" "$repo")" # Create the repository using curl response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X POST "$endpoint" \ diff --git a/src/github/gh-pr-merge.sh b/src/github/gh-pr-merge.sh index 3e3ddb5..cf549ec 100755 --- a/src/github/gh-pr-merge.sh +++ b/src/github/gh-pr-merge.sh @@ -11,7 +11,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function merge_github_pullrequest() { local pr local repo - local OWNER + local owner local pr_title local pr_body local source_branch @@ -39,19 +39,19 @@ function merge_github_pullrequest() { fi # Repo owner - OWNER="$3" + owner="$3" # Verifica se o parâmetro foi fornecido - if [[ -z "$OWNER" ]]; then + if [[ -z "$owner" ]]; then # Se não foi fornecido, utiliza o padrão definido em auth.sh - OWNER="$DEF_GH_OWNER" + owner="$DEF_GH_OWNER" fi # Create the JSON payload for the repository payload='{"merge_method":"squash"}' # Construct URL endpoint - pr_endpoint="$(build_gh_endpoint "PR" "$OWNER" "$repo")" + pr_endpoint="$(build_gh_endpoint "PR" "$owner" "$repo")" endpoint="$pr_endpoint/$pr/merge" # Create the repository using curl diff --git a/src/github/gh-pr-update.sh b/src/github/gh-pr-update.sh index 4b4d3d7..454b930 100755 --- a/src/github/gh-pr-update.sh +++ b/src/github/gh-pr-update.sh @@ -11,7 +11,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function update_github_pullrequest() { local pr local repo - local OWNER + local owner local up_pr_title local up_pr_body local source_branch @@ -39,12 +39,12 @@ function update_github_pullrequest() { fi # Repo owner - OWNER="$3" + owner="$3" # Verifica se o parâmetro foi fornecido - if [[ -z "$OWNER" ]]; then + if [[ -z "$owner" ]]; then # Se não foi fornecido, utiliza o padrão definido em auth.sh - OWNER="$DEF_GH_OWNER" + owner="$DEF_GH_OWNER" fi up_pr_title="$(format_pullrequest "title")" @@ -53,8 +53,8 @@ function update_github_pullrequest() { # Create the JSON payload for the repository payload='{"title":"'"$up_pr_title"'", "body":"'"$up_pr_body"'"}' - #pr_url="$API_URL/$OWNER/$repo/pulls" - pr_endpoint="$(build_gh_endpoint "PR" "$OWNER" "$repo")" + #pr_url="$API_URL/$owner/$repo/pulls" + pr_endpoint="$(build_gh_endpoint "PR" "$owner" "$repo")" endpoint="$pr_endpoint/$pr" # Create the repository using curl diff --git a/src/github/gh-repo-delete.sh b/src/github/gh-repo-delete.sh index 5ce854e..e7f818a 100755 --- a/src/github/gh-repo-delete.sh +++ b/src/github/gh-repo-delete.sh @@ -4,7 +4,7 @@ set -euo pipefail function delete_github_repo() { local repo - local OWNER + local owner local endpoint local response @@ -17,15 +17,15 @@ function delete_github_repo() { fi # Repo owner - OWNER="$2" + owner="$2" # Checks if the parameter was provided or use the default - if [[ -z "$OWNER" ]]; then - OWNER="$DEF_GH_OWNER" + if [[ -z "$owner" ]]; then + owner="$DEF_GH_OWNER" fi # Construct API Endpoint - endpoint="https://api.github.com/repos/$OWNER/$repo" + endpoint="https://api.github.com/repos/$owner/$repo" # Confirm deletion before proceeding echo "Are you sure you want to delete the repository '$repo' (y/N)?" diff --git a/src/github/gh-repo-edit.sh b/src/github/gh-repo-edit.sh index 54d988c..3f25053 100755 --- a/src/github/gh-repo-edit.sh +++ b/src/github/gh-repo-edit.sh @@ -4,7 +4,7 @@ set -euo pipefail function edit_github_repo() { local repo - local OWNER + local owner local new_description local payload local endpoint @@ -28,18 +28,18 @@ function edit_github_repo() { fi # Repo owner - OWNER="$3" + owner="$3" # Checks if the parameter was provided or use the default - if [[ -z "$OWNER" ]]; then - OWNER="$DEF_GH_OWNER" + if [[ -z "$owner" ]]; then + owner="$DEF_GH_OWNER" fi # Create the JSON payload for the repository payload='{"description": "'"$new_description"'"}' # Construct API Endpoint - endpoint="https://api.github.com/repos/$OWNER/$repo" + endpoint="https://api.github.com/repos/$owner/$repo" # Edit the repository using curl response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X PATCH "$endpoint" \ diff --git a/src/gitlab/gl-pr-create.sh b/src/gitlab/gl-pr-create.sh index c146176..752ca0c 100755 --- a/src/gitlab/gl-pr-create.sh +++ b/src/gitlab/gl-pr-create.sh @@ -10,7 +10,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function create_gitlab_pullrequest() { local repo - local OWNER + local owner local pr_title local pr_body local source_branch @@ -29,12 +29,12 @@ function create_gitlab_pullrequest() { fi # Repo owner - OWNER="$2" + owner="$2" # Verifica se o parâmetro foi fornecido - if [[ -z "$OWNER" ]]; then + if [[ -z "$owner" ]]; then # Se não foi fornecido, utiliza o padrão definido em auth.sh - OWNER="$DEF_GL_OWNER" + owner="$DEF_GL_OWNER" fi pr_title="$(format_pullrequest "title")" @@ -49,7 +49,7 @@ function create_gitlab_pullrequest() { "remove_source_branch":"True", "squash":"True"}' # Construct the endpoint URL - endpoint="$(build_gl_endpoint "PR" "$OWNER" "$repo")" + endpoint="$(build_gl_endpoint "PR" "$owner" "$repo")" # Create the repository using curl response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X POST "$endpoint" \ diff --git a/src/gitlab/gl-pr-merge.sh b/src/gitlab/gl-pr-merge.sh index 44cee62..a267ab0 100755 --- a/src/gitlab/gl-pr-merge.sh +++ b/src/gitlab/gl-pr-merge.sh @@ -11,7 +11,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function merge_gitlab_pullrequest() { local pr local repo - local OWNER + local owner local payload local endpoint local response @@ -35,19 +35,19 @@ function merge_gitlab_pullrequest() { fi # Repo owner - OWNER="$3" + owner="$3" # Verifica se o parâmetro foi fornecido - if [[ -z "$OWNER" ]]; then + if [[ -z "$owner" ]]; then # Se não foi fornecido, utiliza o padrão definido em auth.sh - OWNER="$DEF_GH_OWNER" + owner="$DEF_GL_OWNER" fi # Create the JSON payload for the repository payload='{"merge_method":"squash"}' # Construct the endpoint URL - pr_endpoint="$(build_gl_endpoint "PR" "$OWNER" "$repo")" + pr_endpoint="$(build_gl_endpoint "PR" "$owner" "$repo")" endpoint="$pr_endpoint/$pr/merge" # Create the repository using curl diff --git a/src/gitlab/gl-pr-update.sh b/src/gitlab/gl-pr-update.sh index a551960..7dd1ee4 100755 --- a/src/gitlab/gl-pr-update.sh +++ b/src/gitlab/gl-pr-update.sh @@ -11,7 +11,7 @@ source "$GITNAP/utils/format_pullrequest.sh" function update_gitlab_pullrequest() { local pr local repo - local OWNER + local owner local up_pr_title local up_pr_body local payload @@ -37,12 +37,12 @@ function update_gitlab_pullrequest() { fi # Repo owner - OWNER="$3" + owner="$3" # Verifica se o parâmetro foi fornecido - if [[ -z "$OWNER" ]]; then + if [[ -z "$owner" ]]; then # Se não foi fornecido, utiliza o padrão definido em auth.sh - OWNER="$DEF_GH_OWNER" + owner="$DEF_GL_OWNER" fi pr_title="$(format_pullrequest "title")" @@ -52,7 +52,7 @@ function update_gitlab_pullrequest() { payload='{"title":"'"$pr_title"'", "body":"'"$pr_body"'"}' # Construct the endpoint URL - pr_endpoint="$(build_gl_endpoint "PR" "$OWNER" "$repo")" + pr_endpoint="$(build_gl_endpoint "PR" "$owner" "$repo")" endpoint="$pr_endpoint/$pr" # Create the repository using curl diff --git a/src/gitlab/gl-repo-delete.sh b/src/gitlab/gl-repo-delete.sh index 54f8381..463e8f4 100755 --- a/src/gitlab/gl-repo-delete.sh +++ b/src/gitlab/gl-repo-delete.sh @@ -4,7 +4,7 @@ set -euo pipefail function delete_gitlab_repo() { local repo - local OWNER + local owner local endpoint local response @@ -17,16 +17,16 @@ function delete_gitlab_repo() { fi # Repo owner - OWNER="$2" + owner="$2" # Checks if the parameter was provided or use the default - if [[ -z "$OWNER" ]]; then - OWNER="$DEF_GL_OWNER" + if [[ -z "$owner" ]]; then + owner="$DEF_GL_OWNER" fi # Construct API Endpoint SLASH_ENCODED="%2F" - endpoint="https://gitlab.com/api/v4/projects/$OWNER$SLASH_ENCODED$repo" + endpoint="https://gitlab.com/api/v4/projects/$owner$SLASH_ENCODED$repo" # Confirm deletion before proceeding echo "Are you sure you want to delete the repository '$repo' (y/N)?" diff --git a/src/gitlab/gl-repo-edit.sh b/src/gitlab/gl-repo-edit.sh index 59ed128..75a01df 100755 --- a/src/gitlab/gl-repo-edit.sh +++ b/src/gitlab/gl-repo-edit.sh @@ -4,7 +4,7 @@ set -euo pipefail function edit_gitlab_repo() { local repo - local OWNER + local owner local new_description local payload local endpoint @@ -28,11 +28,11 @@ function edit_gitlab_repo() { fi # Repo owner - OWNER="$3" + owner="$3" # Checks if the parameter was provided or use the default - if [[ -z "$OWNER" ]]; then - OWNER="$DEF_GH_OWNER" + if [[ -z "$owner" ]]; then + owner="$DEF_GL_OWNER" fi # Create the JSON payload for the repository @@ -40,7 +40,7 @@ function edit_gitlab_repo() { # Construct API Endpoint SLASH_ENCODED="%2F" - endpoint="https://gitlab.com/api/v4/projects/$OWNER$SLASH_ENCODED$repo" + endpoint="https://gitlab.com/api/v4/projects/$owner$SLASH_ENCODED$repo" # Edit GitLab repository using curl response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X PUT "$endpoint" \ From 8f6a0fef92ca478c578fc0c0b0e65dc9161bbd49 Mon Sep 17 00:00:00 2001 From: Rodrigo Motta Date: Sun, 1 Feb 2026 15:48:29 -0300 Subject: [PATCH 6/7] fix(src): local variable 'QUERY' updated to lower_case naming convention. --- src/github/gh-search-repo.sh | 8 ++++---- src/gitlab/gl-search-repo.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/github/gh-search-repo.sh b/src/github/gh-search-repo.sh index 9e37880..4ff2c47 100755 --- a/src/github/gh-search-repo.sh +++ b/src/github/gh-search-repo.sh @@ -2,21 +2,21 @@ function search_github_repo() { - local QUERY + local query local endpoint local response local tmp_file # String to query - QUERY="$1" + query="$1" # Checks if the parameter was provided - if [[ -z "$QUERY" ]]; then + if [[ -z "$query" ]]; then echo "A query to search is necessary" fi # Construct API Endpoint - endpoint="https://api.github.com/search/repositories?q=$QUERY" + endpoint="https://api.github.com/search/repositories?q=$query" response=$(curl --proto "=https" --tlsv1.2 -sSf -L "$endpoint" \ -H "Accept: application/vnd.github+json" \ diff --git a/src/gitlab/gl-search-repo.sh b/src/gitlab/gl-search-repo.sh index c3fb54b..a1730eb 100755 --- a/src/gitlab/gl-search-repo.sh +++ b/src/gitlab/gl-search-repo.sh @@ -3,21 +3,21 @@ set -euo pipefail function search_gitlab_repo() { - local QUERY + local query local endpoint local response local tmp_file # String to query - QUERY="$1" + query="$1" # Checks if the parameter was provided - if [[ -z "$QUERY" ]]; then + if [[ -z "$query" ]]; then echo "A query to search is necessary" fi # Construct API Endpoint - endpoint="https://gitlab.com/api/v4/search?scope=projects&search=$QUERY" + endpoint="https://gitlab.com/api/v4/search?scope=projects&search=$query" # CURL and jq response=$(curl --proto "=https" --tlsv1.2 -sSf -L "$endpoint" \ From 9c6c675e55657b66b9e1748e164e4824652e4ed5 Mon Sep 17 00:00:00 2001 From: Rodrigo Motta Date: Sun, 1 Feb 2026 15:59:27 -0300 Subject: [PATCH 7/7] fix(src): local variable 'SLASH_ENCODED' updated to lower_case naming convention. --- src/gitlab/gl-repo-delete.sh | 4 ++-- src/gitlab/gl-repo-edit.sh | 4 ++-- src/utils/endpoints.sh | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gitlab/gl-repo-delete.sh b/src/gitlab/gl-repo-delete.sh index 463e8f4..5ceecaf 100755 --- a/src/gitlab/gl-repo-delete.sh +++ b/src/gitlab/gl-repo-delete.sh @@ -25,8 +25,8 @@ function delete_gitlab_repo() { fi # Construct API Endpoint - SLASH_ENCODED="%2F" - endpoint="https://gitlab.com/api/v4/projects/$owner$SLASH_ENCODED$repo" + slash_encoded="%2F" + endpoint="https://gitlab.com/api/v4/projects/$owner$slash_encoded$repo" # Confirm deletion before proceeding echo "Are you sure you want to delete the repository '$repo' (y/N)?" diff --git a/src/gitlab/gl-repo-edit.sh b/src/gitlab/gl-repo-edit.sh index 75a01df..9cc218a 100755 --- a/src/gitlab/gl-repo-edit.sh +++ b/src/gitlab/gl-repo-edit.sh @@ -39,8 +39,8 @@ function edit_gitlab_repo() { payload='{"description": "'"$new_description"'"}' # Construct API Endpoint - SLASH_ENCODED="%2F" - endpoint="https://gitlab.com/api/v4/projects/$owner$SLASH_ENCODED$repo" + slash_encoded="%2F" + endpoint="https://gitlab.com/api/v4/projects/$owner$slash_encoded$repo" # Edit GitLab repository using curl response=$(curl --proto "=https" --tlsv1.2 -sSf -L -X PUT "$endpoint" \ diff --git a/src/utils/endpoints.sh b/src/utils/endpoints.sh index a532199..7c4609d 100755 --- a/src/utils/endpoints.sh +++ b/src/utils/endpoints.sh @@ -87,12 +87,12 @@ function build_gl_endpoint() { local route local owner local repo - local SLASH_ENCODED + local slash_encoded route="$1" owner="$2" repo="$3" - SLASH_ENCODED="%2F" + slash_encoded="%2F" if [[ -z "$route" || -z "$owner" || -z "$repo" ]]; then echo "Error: route, owner, and repository are required for Gitlab." @@ -102,10 +102,10 @@ function build_gl_endpoint() { # Endpoint selector case "$route" in PR) - endpoint="$GL_URL/$GL_REPO_EP/$owner$SLASH_ENCODED$repo/merge_requests" + endpoint="$GL_URL/$GL_REPO_EP/$owner$slash_encoded$repo/merge_requests" ;; REPOS) - endpoint="$GL_URL/$GL_REPO_EP/$owner$SLASH_ENCODED$repo" + endpoint="$GL_URL/$GL_REPO_EP/$owner$slash_encoded$repo" ;; # ... adicionar outras rotas específicas do Gitlab *)