Skip to content

Commit 66dc273

Browse files
committed
fix "readonly"
1 parent 346b177 commit 66dc273

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

hooks/terragrunt_fmt.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ function main {
1414
common::parse_and_export_env_vars
1515
# JFYI: `terragrunt hcl format` color already suppressed via PRE_COMMIT_COLOR=never
1616

17-
readonly SUBCOMMAND
18-
common::terragrunt_version_ge_0.78 && SUBCOMMAND=(hcl format) || SUBCOMMAND=(hclfmt)
17+
if common::terragrunt_version_ge_0.78; then
18+
local -ra SUBCOMMAND=(hcl format)
19+
else
20+
local -ra SUBCOMMAND=(hclfmt)
21+
fi
1922

2023
# shellcheck disable=SC2153 # False positive
2124
common::per_dir_hook "$HOOK_ID" "${#ARGS[@]}" "${ARGS[@]}" "${FILES[@]}"

hooks/terragrunt_providers_lock.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ function main {
1414
common::parse_and_export_env_vars
1515
# JFYI: terragrunt providers lock color already suppressed via PRE_COMMIT_COLOR=never
1616

17-
readonly RUN_ALL_SUBCOMMAND
1817
if common::terragrunt_version_ge_0.78; then
19-
RUN_ALL_SUBCOMMAND=(run --all providers lock)
18+
local -ra RUN_ALL_SUBCOMMAND=(run --all providers lock)
2019
else
21-
RUN_ALL_SUBCOMMAND=(run-all providers lock)
20+
local -ra RUN_ALL_SUBCOMMAND=(run-all providers lock)
2221
fi
2322

2423
# shellcheck disable=SC2153 # False positive

hooks/terragrunt_validate.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ function main {
1414
common::parse_and_export_env_vars
1515
# JFYI: terragrunt validate color already suppressed via PRE_COMMIT_COLOR=never
1616

17-
readonly RUN_ALL_SUBCOMMAND
1817
if common::terragrunt_version_ge_0.78; then
19-
RUN_ALL_SUBCOMMAND=(run --all validate)
18+
local -ra RUN_ALL_SUBCOMMAND=(run --all validate)
2019
else
21-
RUN_ALL_SUBCOMMAND=(run-all validate)
20+
local -ra RUN_ALL_SUBCOMMAND=(run-all validate)
2221
fi
2322

2423
# shellcheck disable=SC2153 # False positive

hooks/terragrunt_validate_inputs.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ function main {
1414
common::parse_and_export_env_vars
1515
# JFYI: terragrunt validate color already suppressed via PRE_COMMIT_COLOR=never
1616

17-
readonly SUBCOMMAND
18-
readonly RUN_ALL_SUBCOMMAND
1917
if common::terragrunt_version_ge_0.78; then
20-
SUBCOMMAND=(hcl validate --inputs)
21-
RUN_ALL_SUBCOMMAND=(run --all hcl validate --inputs)
18+
local -ra SUBCOMMAND=(hcl validate --inputs)
19+
local -ra RUN_ALL_SUBCOMMAND=(run --all hcl validate --inputs)
2220
else
23-
SUBCOMMAND=(validate-inputs)
24-
RUN_ALL_SUBCOMMAND=(run-all validate-inputs)
21+
local -ra SUBCOMMAND=(validate-inputs)
22+
local -ra RUN_ALL_SUBCOMMAND=(run-all validate-inputs)
2523
fi
2624

2725
# shellcheck disable=SC2153 # False positive

0 commit comments

Comments
 (0)