Commit ed9db97 1 parent 3adde17 commit ed9db97 Copy full SHA for ed9db97
File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -145,8 +145,13 @@ function terraform_docs {
145
145
had_config_flag=true
146
146
local config_file=${args#* --config}
147
147
config_file=${config_file#* =}
148
- config_file=${config_file% --* }
149
- args=${args/ --config=$config_file / }
148
+ # If there are more parameters after config path, trim until --
149
+ if [[ $config_file == * " --" * ]]; then
150
+ config_file=${config_file%% --* }
151
+ fi
152
+ # Trim trailing whitespace but preserve internal spaces
153
+
154
+ config_file=" ${config_file% " ${config_file##* [![:space:]]} " } " args=${args/ --config=$config_file / }
150
155
151
156
# Prioritize `.terraform-docs.yml` `output.file` over
152
157
# `--hook-config=--path-to-file=` if it set
@@ -234,7 +239,7 @@ function terraform_docs {
234
239
fi
235
240
local config_options=" "
236
241
if [[ $had_config_flag == true ]]; then
237
- config_options=" --config=$config_file "
242
+ config_options=" --config=$config_file "
238
243
fi
239
244
# shellcheck disable=SC2086
240
245
terraform-docs --output-mode=" $output_mode " --output-file=" $output_file " $tf_docs_formatter " $config_options " $args ./ > /dev/null
You can’t perform that action at this time.
0 commit comments