From 59b2454e076a9d26ad93d0ca4037746fd7f5962d Mon Sep 17 00:00:00 2001 From: Maksym Vlasov Date: Tue, 27 Aug 2024 20:16:38 +0300 Subject: [PATCH] fix(`terraform_docs`): Suppress redundant warnings pop-ups introduced in v1.92.2 (#700) --- hooks/terraform_docs.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hooks/terraform_docs.sh b/hooks/terraform_docs.sh index 657853983..770f947a5 100755 --- a/hooks/terraform_docs.sh +++ b/hooks/terraform_docs.sh @@ -175,12 +175,14 @@ function terraform_docs { if [[ $output_file ]]; then # Extract filename from `output.file` line - text_file=$(echo "$output_file" | awk -F':' '{print $2}' | tr -d '[:space:]"' | tr -d "'") + output_file=$(echo "$output_file" | awk -F':' '{print $2}' | tr -d '[:space:]"' | tr -d "'") - if [[ $use_path_to_file ]]; then - common::colorify "yellow" "NOTE: You set both '--hook-config=--path-to-file=' and 'output.file' in '$config_file'" + if [[ $use_path_to_file == true && "$output_file" != "$text_file" ]]; then + common::colorify "yellow" "NOTE: You set both '--hook-config=--path-to-file=$text_file' and 'output.file: $output_file' in '$config_file'" common::colorify "yellow" " 'output.file' from '$config_file' will be used." fi + + text_file=$output_file fi # Suppress terraform_docs color