Skip to content

Commit

Permalink
Fix "redefinition" of global vars in function
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxymVlasov committed Mar 14, 2024
1 parent cb59613 commit 65ba593
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 37 deletions.
8 changes: 4 additions & 4 deletions tools/install/hcledit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
# Unique part
#

readonly GH_ORG="minamijoyo"
readonly GH_RELEASE_REGEX_LATEST="https://.+?_${TARGETOS}_${TARGETARCH}.tar.gz"
readonly GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?${VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz"
readonly DISTRIBUTED_AS="tar.gz"
GH_ORG="minamijoyo"
GH_RELEASE_REGEX_LATEST="https://.+?_${TARGETOS}_${TARGETARCH}.tar.gz"
GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?${VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz"
DISTRIBUTED_AS="tar.gz"

common::install_from_gh_release "$GH_ORG" "$DISTRIBUTED_AS" \
"$GH_RELEASE_REGEX_LATEST" "$GH_RELEASE_REGEX_SPECIFIC_VERSION"
10 changes: 5 additions & 5 deletions tools/install/infracost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
#
# Unique part
#
readonly GH_ORG="infracost"
readonly GH_RELEASE_REGEX_LATEST="https://.+?-${TARGETOS}-${TARGETARCH}.tar.gz"
readonly GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?v${VERSION}/${TOOL}-${TARGETOS}-${TARGETARCH}.tar.gz"
readonly DISTRIBUTED_AS="tar.gz"
readonly UNUSUAL_TOOL_NAME_IN_PKG="${TOOL}-${TARGETOS}-${TARGETARCH}"
GH_ORG="infracost"
GH_RELEASE_REGEX_LATEST="https://.+?-${TARGETOS}-${TARGETARCH}.tar.gz"
GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?v${VERSION}/${TOOL}-${TARGETOS}-${TARGETARCH}.tar.gz"
DISTRIBUTED_AS="tar.gz"
UNUSUAL_TOOL_NAME_IN_PKG="${TOOL}-${TARGETOS}-${TARGETARCH}"

common::install_from_gh_release "$GH_ORG" "$DISTRIBUTED_AS" \
"$GH_RELEASE_REGEX_LATEST" "$GH_RELEASE_REGEX_SPECIFIC_VERSION" \
Expand Down
8 changes: 4 additions & 4 deletions tools/install/terraform-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
#
# Unique part
#
readonly GH_ORG="terraform-docs"
readonly GH_RELEASE_REGEX_LATEST="https://.+?-${TARGETOS}-${TARGETARCH}.tar.gz"
readonly GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?v${VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz"
readonly DISTRIBUTED_AS="tar.gz"
GH_ORG="terraform-docs"
GH_RELEASE_REGEX_LATEST="https://.+?-${TARGETOS}-${TARGETARCH}.tar.gz"
GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?v${VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz"
DISTRIBUTED_AS="tar.gz"

common::install_from_gh_release "$GH_ORG" "$DISTRIBUTED_AS" \
"$GH_RELEASE_REGEX_LATEST" "$GH_RELEASE_REGEX_SPECIFIC_VERSION"
8 changes: 4 additions & 4 deletions tools/install/terragrunt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
#
# Unique part
#
readonly GH_ORG="gruntwork-io"
readonly GH_RELEASE_REGEX_LATEST="https://.+?/${TOOL}_${TARGETOS}_${TARGETARCH}"
readonly GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?v${VERSION}/${TOOL}_${TARGETOS}_${TARGETARCH}"
readonly DISTRIBUTED_AS="binary"
GH_ORG="gruntwork-io"
GH_RELEASE_REGEX_LATEST="https://.+?/${TOOL}_${TARGETOS}_${TARGETARCH}"
GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?v${VERSION}/${TOOL}_${TARGETOS}_${TARGETARCH}"
DISTRIBUTED_AS="binary"

common::install_from_gh_release "$GH_ORG" "$DISTRIBUTED_AS" \
"$GH_RELEASE_REGEX_LATEST" "$GH_RELEASE_REGEX_SPECIFIC_VERSION"
8 changes: 4 additions & 4 deletions tools/install/terrascan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ fi
# Convert the first letter to Uppercase
OS="${TARGETOS^}"

readonly GH_ORG="tenable"
readonly GH_RELEASE_REGEX_LATEST="https://.+?_${OS}_${ARCH}.tar.gz"
readonly GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?${VERSION}_${OS}_${ARCH}.tar.gz"
readonly DISTRIBUTED_AS="tar.gz"
GH_ORG="tenable"
GH_RELEASE_REGEX_LATEST="https://.+?_${OS}_${ARCH}.tar.gz"
GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?${VERSION}_${OS}_${ARCH}.tar.gz"
DISTRIBUTED_AS="tar.gz"

common::install_from_gh_release "$GH_ORG" "$DISTRIBUTED_AS" \
"$GH_RELEASE_REGEX_LATEST" "$GH_RELEASE_REGEX_SPECIFIC_VERSION"
Expand Down
8 changes: 4 additions & 4 deletions tools/install/tflint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
# Unique part
#

readonly GH_ORG="terraform-linters"
readonly GH_RELEASE_REGEX_LATEST="https://.+?_${TARGETOS}_${TARGETARCH}.zip"
readonly GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?/v${VERSION}/${TOOL}_${TARGETOS}_${TARGETARCH}.zip"
readonly DISTRIBUTED_AS="zip"
GH_ORG="terraform-linters"
GH_RELEASE_REGEX_LATEST="https://.+?_${TARGETOS}_${TARGETARCH}.zip"
GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?/v${VERSION}/${TOOL}_${TARGETOS}_${TARGETARCH}.zip"
DISTRIBUTED_AS="zip"

common::install_from_gh_release "$GH_ORG" "$DISTRIBUTED_AS" \
"$GH_RELEASE_REGEX_LATEST" "$GH_RELEASE_REGEX_SPECIFIC_VERSION"
8 changes: 4 additions & 4 deletions tools/install/tfsec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
# Unique part
#

readonly GH_ORG="aquasecurity"
readonly GH_RELEASE_REGEX_LATEST="https://.+?/${TOOL}-${TARGETOS}-${TARGETARCH}"
readonly GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?v${VERSION}/${TOOL}-${TARGETOS}-${TARGETARCH}"
readonly DISTRIBUTED_AS="binary"
GH_ORG="aquasecurity"
GH_RELEASE_REGEX_LATEST="https://.+?/${TOOL}-${TARGETOS}-${TARGETARCH}"
GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?v${VERSION}/${TOOL}-${TARGETOS}-${TARGETARCH}"
DISTRIBUTED_AS="binary"

common::install_from_gh_release "$GH_ORG" "$DISTRIBUTED_AS" \
"$GH_RELEASE_REGEX_LATEST" "$GH_RELEASE_REGEX_SPECIFIC_VERSION"
8 changes: 4 additions & 4 deletions tools/install/tfupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
#
# Unique part
#
readonly GH_ORG="minamijoyo"
readonly GH_RELEASE_REGEX_LATEST="https://.+?_${TARGETOS}_${TARGETARCH}.tar.gz"
readonly GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?${VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz"
readonly DISTRIBUTED_AS="tar.gz"
GH_ORG="minamijoyo"
GH_RELEASE_REGEX_LATEST="https://.+?_${TARGETOS}_${TARGETARCH}.tar.gz"
GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?${VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz"
DISTRIBUTED_AS="tar.gz"

common::install_from_gh_release "$GH_ORG" "$DISTRIBUTED_AS" \
"$GH_RELEASE_REGEX_LATEST" "$GH_RELEASE_REGEX_SPECIFIC_VERSION"
8 changes: 4 additions & 4 deletions tools/install/trivy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ else
readonly ARCH="64bit"
fi

readonly GH_ORG="aquasecurity"
readonly GH_RELEASE_REGEX_LATEST="https://.+?/${TOOL}_.+?_${TARGETOS}-${ARCH}.tar.gz"
readonly GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?/v${VERSION}/${TOOL}_.+?_${TARGETOS}-${ARCH}.tar.gz"
readonly DISTRIBUTED_AS="tar.gz"
GH_ORG="aquasecurity"
GH_RELEASE_REGEX_LATEST="https://.+?/${TOOL}_.+?_${TARGETOS}-${ARCH}.tar.gz"
GH_RELEASE_REGEX_SPECIFIC_VERSION="https://.+?/v${VERSION}/${TOOL}_.+?_${TARGETOS}-${ARCH}.tar.gz"
DISTRIBUTED_AS="tar.gz"

common::install_from_gh_release "$GH_ORG" "$DISTRIBUTED_AS" \
"$GH_RELEASE_REGEX_LATEST" "$GH_RELEASE_REGEX_SPECIFIC_VERSION"

0 comments on commit 65ba593

Please sign in to comment.