mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 02:55:19 +00:00
6817b4348f
This updates config-help to have more control over how the output is written for the user. We dump config-help output for per-generator documentation, and this cleans up some cross-platform compatibility issues that might arise from tweaking the output for clarity in the target file. Previously, we'd pipe config-help output to sed, then insert the generator name, which we then redirected to an output file. The sed syntax had to include a trailing newline so our tabbed configs would automatically become code tags in markdown. Inserting newlines into sed replacement strings doesn't work the same across platforms, mostly because of Apple's customizations to GNU programs. This commit moves the generator name and newline insertion into the command itself. It also includes a new --output option, allowing the user to specify the output location of the config-help. Currently, we only dump in plain-text, and it is only coincidental that our plaintext output results in a desirable Markdown output. If tabbed lines did not automatically convert to a code style block, some generators like C# would end up with broken text (`List<T>` would become just `List`, for example). I had previously discussed extending config-help to output to other formats like asciidoc. This commit does not introduce any steps toward that end.
12 lines
278 B
Bash
Executable File
12 lines
278 B
Bash
Executable File
#!/bin/bash
|
|
|
|
SCRIPT="$0"
|
|
echo "# START SCRIPT: ${SCRIPT}"
|
|
|
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
|
|
|
for GENERATOR in $(java -jar ${executable} list --short | sed -e 's/,/\'$'\n''/g')
|
|
do
|
|
./bin/utils/export_generator.sh ${GENERATOR}
|
|
done
|