From f24b3fab71b248c4be75ec378c43e6921053491a Mon Sep 17 00:00:00 2001 From: Roma Ryzhyi <110890299+ajax-ryzhyi-r@users.noreply.github.com> Date: Thu, 10 Aug 2023 14:44:01 +0300 Subject: [PATCH] fix: Fix the terraform_wrapper_module_for_each hook for modules without outputs or variables (#552) Co-authored-by: Anton Babenko --- hooks/terraform_wrapper_module_for_each.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/terraform_wrapper_module_for_each.sh b/hooks/terraform_wrapper_module_for_each.sh index ed8e9b1..522c329 100755 --- a/hooks/terraform_wrapper_module_for_each.sh +++ b/hooks/terraform_wrapper_module_for_each.sh @@ -323,11 +323,11 @@ EOF # Get names of module variables in all terraform files # shellcheck disable=SC2207 - module_vars=($(echo "$all_tf_content" | hcledit block list | grep variable. | cut -d'.' -f 2)) + module_vars=($(echo "$all_tf_content" | hcledit block list | { grep variable. || true; } | cut -d'.' -f 2)) # Get names of module outputs in all terraform files # shellcheck disable=SC2207 - module_outputs=($(echo "$all_tf_content" | hcledit block list | grep output. | cut -d'.' -f 2)) + module_outputs=($(echo "$all_tf_content" | hcledit block list | { grep output. || true; } | cut -d'.' -f 2)) # Looking for sensitive output local wrapper_output_sensitive="# sensitive = false # No sensitive module output found"