File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -536,13 +536,13 @@ function common::terraform_init {
536
536
# Plugin cache dir can't be written concurrently or read during write
537
537
# https://github.com/hashicorp/terraform/issues/31964
538
538
if [[ -z $TF_PLUGIN_CACHE_DIR || $parallelism_disabled == true ]]; then
539
- init_output=$( $tf_path init -backend=false " ${TF_INIT_ARGS[@]} " 2>&1 )
539
+ init_output=$( " $tf_path " init -backend=false " ${TF_INIT_ARGS[@]} " 2>&1 )
540
540
exit_code=$?
541
541
else
542
542
# Locking just doesn't work, and the below works quicker instead. Details:
543
543
# https://github.com/hashicorp/terraform/issues/31964#issuecomment-1939869453
544
544
for i in {1..10}; do
545
- init_output=$( $tf_path init -backend=false " ${TF_INIT_ARGS[@]} " 2>&1 )
545
+ init_output=$( " $tf_path " init -backend=false " ${TF_INIT_ARGS[@]} " 2>&1 )
546
546
exit_code=$?
547
547
548
548
if [ $exit_code -eq 0 ]; then
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ function per_dir_hook_unique_part {
49
49
local -a -r args=(" $@ " )
50
50
51
51
# pass the arguments to hook
52
- $tf_path fmt " ${args[@]} "
52
+ " $tf_path " fmt " ${args[@]} "
53
53
54
54
# return exit code to common::per_dir_hook
55
55
local exit_code=$?
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ function per_dir_hook_unique_part {
140
140
common::colorify " yellow" " DEPRECATION NOTICE: We introduced '--mode' flag for this hook.
141
141
Check migration instructions at https://github.com/antonbabenko/pre-commit-terraform#terraform_providers_lock
142
142
"
143
- common::terraform_init ' terraform providers lock' " $dir_path " " $parallelism_disabled " " $tf_path " || {
143
+ common::terraform_init " $tf_path providers lock" " $dir_path " " $parallelism_disabled " " $tf_path " || {
144
144
exit_code=$?
145
145
return $exit_code
146
146
}
@@ -155,7 +155,7 @@ Check migration instructions at https://github.com/antonbabenko/pre-commit-terra
155
155
# ? Don't require `tf init` for providers, but required `tf init` for modules
156
156
# ? Mitigated by `function match_validate_errors` from terraform_validate hook
157
157
# pass the arguments to hook
158
- $tf_path providers lock " ${args[@]} "
158
+ " $tf_path " providers lock " ${args[@]} "
159
159
160
160
# return exit code to common::per_dir_hook
161
161
exit_code=$?
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ function per_dir_hook_unique_part {
118
118
# First try `terraform validate` with the hope that all deps are
119
119
# pre-installed. That is needed for cases when `.terraform/modules`
120
120
# or `.terraform/providers` missed AND that is expected.
121
- $tf_path validate " ${args[@]} " & > /dev/null && {
121
+ " $tf_path " validate " ${args[@]} " & > /dev/null && {
122
122
exit_code=$?
123
123
return $exit_code
124
124
}
@@ -132,11 +132,11 @@ function per_dir_hook_unique_part {
132
132
133
133
if [ " $retry_once_with_cleanup " != " true" ]; then
134
134
# terraform validate only
135
- validate_output=$( $tf_path validate " ${args[@]} " 2>&1 )
135
+ validate_output=$( " $tf_path " validate " ${args[@]} " 2>&1 )
136
136
exit_code=$?
137
137
else
138
138
# terraform validate, plus capture possible errors
139
- validate_output=$( $tf_path validate -json " ${args[@]} " 2>&1 )
139
+ validate_output=$( " $tf_path " validate -json " ${args[@]} " 2>&1 )
140
140
exit_code=$?
141
141
142
142
# Match specific validation errors
@@ -159,7 +159,7 @@ function per_dir_hook_unique_part {
159
159
return $exit_code
160
160
}
161
161
162
- validate_output=$( $tf_path validate " ${args[@]} " 2>&1 )
162
+ validate_output=$( " $tf_path " validate " ${args[@]} " 2>&1 )
163
163
exit_code=$?
164
164
fi
165
165
fi
You can’t perform that action at this time.
0 commit comments