Skip to content

Commit a088ccf

Browse files
authored
Update generate-client-from-openapi-descriptor.sh
1 parent 814da81 commit a088ccf

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

scripts/generate-client-from-openapi-descriptor.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ CLIENT_SOURCE_FOLDER="client"
1212

1313
# Utility functions
1414
function write_step(){
15-
echo -e "\e[93m$1\e[0m"
15+
echo -e "\e[93m$1\e[0m"
1616
}
1717

1818
# Entry point
1919
if [ "$#" -lt 1 ]; then
20-
script_name=$(basename "$0")
21-
echo "Usage:"
22-
echo " $script_name [OPENAPI_DESCRIPTOR_YAML_FILE] [CLIENT_TECHNOLOGY]"
23-
echo ""
24-
echo "CLIENT_TECHNOLOGY is optional and default to 'java'."
25-
echo ""
26-
echo "Call example:"
27-
echo " $script_name openapi.yml"
28-
echo " $script_name openapi.yml python"
29-
exit 1
20+
script_name=$(basename "$0")
21+
echo "Usage:"
22+
echo " $script_name [OPENAPI_DESCRIPTOR_YAML_FILE] [CLIENT_TECHNOLOGY]"
23+
echo ""
24+
echo "CLIENT_TECHNOLOGY is optional and default to 'java'."
25+
echo ""
26+
echo "Call example:"
27+
echo " $script_name openapi.yml"
28+
echo " $script_name openapi.yml python"
29+
exit 1
3030
fi
3131

3232
# Main processing
@@ -38,12 +38,12 @@ then
3838
fi
3939
if [ ! -f $CLI_JAR_FILE ]
4040
then
41-
write_step "[+] Download the OpenAPI generator CLI from the Maven repository..."
41+
write_step "[+] Download the OpenAPI generator CLI from the Maven repository..."
4242
cli_version=$(curl -sk "$ARTEFACT_BASE_URL/maven-metadata.xml" | grep -F "<release>" | cut -d '>' -f2 | cut -d '<' -f1 | tr -d ' ')
4343
curl -sk --output $CLI_JAR_FILE "$ARTEFACT_BASE_URL/$cli_version/openapi-generator-cli-$cli_version.jar"
4444
file $CLI_JAR_FILE
4545
fi
4646
write_step "[+] Generate the '$tech' client code into the folder '$CLIENT_SOURCE_FOLDER' ..."
4747
rm -rf $CLIENT_SOURCE_FOLDER/
4848
java -jar $CLI_JAR_FILE generate -g $tech -o $CLIENT_SOURCE_FOLDER -i $openapi_descriptor_file 1>/dev/null
49-
ls -l $CLIENT_SOURCE_FOLDER
49+
ls -l $CLIENT_SOURCE_FOLDER

0 commit comments

Comments
 (0)