File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,13 @@ 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
18+ if common::terragrunt_version_ge_0.78; then
19+ RUN_ALL_SUBCOMMAND=(run --all providers lock)
20+ else
21+ RUN_ALL_SUBCOMMAND=(run-all providers lock)
22+ fi
23+
1724 # shellcheck disable=SC2153 # False positive
1825 common::per_dir_hook " $HOOK_ID " " ${# ARGS[@]} " " ${ARGS[@]} " " ${FILES[@]} "
1926}
@@ -63,7 +70,7 @@ function run_hook_on_whole_repo {
6370 local -a -r args=(" $@ " )
6471
6572 # pass the arguments to hook
66- terragrunt run-all providers lock " ${args[@]} "
73+ terragrunt " ${RUN_ALL_SUBCOMMAND[@]} " " ${args[@]} "
6774
6875 # return exit code to common::per_dir_hook
6976 local exit_code=$?
Original file line number Diff line number Diff line change @@ -14,6 +14,13 @@ 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
18+ if common::terragrunt_version_ge_0.78; then
19+ RUN_ALL_SUBCOMMAND=(run --all validate)
20+ else
21+ RUN_ALL_SUBCOMMAND=(run-all validate)
22+ fi
23+
1724 # shellcheck disable=SC2153 # False positive
1825 common::per_dir_hook " $HOOK_ID " " ${# ARGS[@]} " " ${ARGS[@]} " " ${FILES[@]} "
1926}
@@ -63,7 +70,7 @@ function run_hook_on_whole_repo {
6370 local -a -r args=(" $@ " )
6471
6572 # pass the arguments to hook
66- terragrunt run-all validate " ${args[@]} "
73+ terragrunt " ${RUN_ALL_SUBCOMMAND[@]} " " ${args[@]} "
6774
6875 # return exit code to common::per_dir_hook
6976 local exit_code=$?
You can’t perform that action at this time.
0 commit comments