Skip to content

Commit 59b2454

Browse files
authored
fix(terraform_docs): Suppress redundant warnings pop-ups introduced in v1.92.2 (antonbabenko#700)
1 parent f809e53 commit 59b2454

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

hooks/terraform_docs.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,14 @@ function terraform_docs {
175175

176176
if [[ $output_file ]]; then
177177
# Extract filename from `output.file` line
178-
text_file=$(echo "$output_file" | awk -F':' '{print $2}' | tr -d '[:space:]"' | tr -d "'")
178+
output_file=$(echo "$output_file" | awk -F':' '{print $2}' | tr -d '[:space:]"' | tr -d "'")
179179

180-
if [[ $use_path_to_file ]]; then
181-
common::colorify "yellow" "NOTE: You set both '--hook-config=--path-to-file=' and 'output.file' in '$config_file'"
180+
if [[ $use_path_to_file == true && "$output_file" != "$text_file" ]]; then
181+
common::colorify "yellow" "NOTE: You set both '--hook-config=--path-to-file=$text_file' and 'output.file: $output_file' in '$config_file'"
182182
common::colorify "yellow" " 'output.file' from '$config_file' will be used."
183183
fi
184+
185+
text_file=$output_file
184186
fi
185187

186188
# Suppress terraform_docs color

0 commit comments

Comments
 (0)