Skip to content

Commit 3adde17

Browse files
committed
fix(terraform-docs): apply suggested fix for script execution
1 parent 611b708 commit 3adde17

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

hooks/terraform_docs.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env bash
22
set -eo pipefail
3-
43
# globals variables
54
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
65
readonly SCRIPT_DIR
@@ -233,13 +232,12 @@ function terraform_docs {
233232
have_marker=$(grep -o "$insertion_marker_begin" "$output_file") || unset have_marker
234233
[[ ! $have_marker ]] && popd > /dev/null && continue
235234
fi
235+
local config_options=""
236236
if [[ $had_config_flag == true ]]; then
237-
# shellcheck disable=SC2086
238-
terraform-docs --output-mode="$output_mode" --output-file="$output_file" $tf_docs_formatter --config="$config_file" $args ./ > /dev/null
239-
else
240-
# shellcheck disable=SC2086
241-
terraform-docs --output-mode="$output_mode" --output-file="$output_file" $tf_docs_formatter $config_arg $args ./ > /dev/null
237+
config_options="--config=$config_file"
242238
fi
239+
# shellcheck disable=SC2086
240+
terraform-docs --output-mode="$output_mode" --output-file="$output_file" $tf_docs_formatter "$config_options" $args ./ > /dev/null
243241

244242
popd > /dev/null
245243
done

0 commit comments

Comments
 (0)