Skip to content

Commit 05339b7

Browse files
committed
fix(terraform_docs): apply some of yermulnik suggestions
1 parent a6bf17a commit 05339b7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

hooks/terraform_docs.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22
set -eo pipefail
3+
34
# globals variables
45
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
56
readonly SCRIPT_DIR
@@ -237,10 +238,8 @@ function terraform_docs {
237238
have_marker=$(grep -o "$insertion_marker_begin" "$output_file") || unset have_marker
238239
[[ ! $have_marker ]] && popd > /dev/null && continue
239240
fi
240-
local config_options=""
241-
if [[ $have_config_flag == true ]]; then
242-
config_options="--config=$config_file"
243-
fi
241+
local config_options
242+
[[ $have_config_flag == true ]] && config_options="--config=$config_file"
244243
# shellcheck disable=SC2086
245244
terraform-docs --output-mode="$output_mode" --output-file="$output_file" $tf_docs_formatter "$config_options" $args ./ > /dev/null
246245

0 commit comments

Comments
 (0)