File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,11 @@ function terraform_docs {
135
135
esac
136
136
done
137
137
138
+ #
139
+ # Override formatter if no config file set
140
+ #
141
+ [[ " $args " != * " --config=" * ]] && local tf_docs_formatter=" md"
142
+
138
143
local dir_path
139
144
for dir_path in $( echo " ${paths[*]} " | tr ' ' ' \n' | sort -u) ; do
140
145
dir_path=" ${dir_path// __REPLACED__SPACE__/ } "
@@ -181,7 +186,7 @@ function terraform_docs {
181
186
182
187
if [[ " $terraform_docs_awk_file " == " 0" ]]; then
183
188
# shellcheck disable=SC2086
184
- terraform-docs md $args ./ > " $tmp_file "
189
+ terraform-docs $tf_docs_formatter $args ./ > " $tmp_file "
185
190
else
186
191
# Can't append extension for mktemp, so renaming instead
187
192
local tmp_file_docs
@@ -192,7 +197,7 @@ function terraform_docs {
192
197
193
198
awk -f " $terraform_docs_awk_file " ./* .tf > " $tmp_file_docs_tf "
194
199
# shellcheck disable=SC2086
195
- terraform-docs md $args " $tmp_file_docs_tf " > " $tmp_file "
200
+ terraform-docs $tf_docs_formatter $args " $tmp_file_docs_tf " > " $tmp_file "
196
201
rm -f " $tmp_file_docs_tf "
197
202
fi
198
203
You can’t perform that action at this time.
0 commit comments