From 4ea6b14c6fdf48e33fa6e116cbe332bba0888bbb Mon Sep 17 00:00:00 2001 From: Maksym Vlasov Date: Wed, 11 Oct 2023 14:57:15 +0300 Subject: [PATCH] fix: Suppress duplicate error messages in `terraform_validate` (#577) Co-authored-by: George L. Yermulnik --- hooks/terraform_validate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/terraform_validate.sh b/hooks/terraform_validate.sh index 0ba67817d..2386be465 100755 --- a/hooks/terraform_validate.sh +++ b/hooks/terraform_validate.sh @@ -113,7 +113,7 @@ function per_dir_hook_unique_part { # First try `terraform validate` with the hope that all deps are # pre-installed. That is needed for cases when `.terraform/modules` # or `.terraform/providers` missed AND that is expected. - terraform validate "${args[@]}" 2>&1 && { + terraform validate "${args[@]}" &> /dev/null && { exit_code=$? return $exit_code }