Skip to content

Commit f24b3fa

Browse files
fix: Fix the terraform_wrapper_module_for_each hook for modules without outputs or variables (antonbabenko#552)
Co-authored-by: Anton Babenko <[email protected]>
1 parent 789973b commit f24b3fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hooks/terraform_wrapper_module_for_each.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,11 @@ EOF
323323

324324
# Get names of module variables in all terraform files
325325
# shellcheck disable=SC2207
326-
module_vars=($(echo "$all_tf_content" | hcledit block list | grep variable. | cut -d'.' -f 2))
326+
module_vars=($(echo "$all_tf_content" | hcledit block list | { grep variable. || true; } | cut -d'.' -f 2))
327327

328328
# Get names of module outputs in all terraform files
329329
# shellcheck disable=SC2207
330-
module_outputs=($(echo "$all_tf_content" | hcledit block list | grep output. | cut -d'.' -f 2))
330+
module_outputs=($(echo "$all_tf_content" | hcledit block list | { grep output. || true; } | cut -d'.' -f 2))
331331

332332
# Looking for sensitive output
333333
local wrapper_output_sensitive="# sensitive = false # No sensitive module output found"

0 commit comments

Comments
 (0)