Last active
March 26, 2018 01:35
-
-
Save jimschubert/62baf653a9520b23399a67755c33631a to your computer and use it in GitHub Desktop.
Quick script for running swagger codegen cli directly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ver=2.3.1 | |
jar=swagger-codegen-cli-$ver.jar | |
md5=c838c266b80401ecd43521890b4abea8 | |
repo="http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/$ver/$jar" | |
if [ ! -f $jar ]; then | |
echo "[info] downloading $PWD/$jar from $repo" 1>&2 | |
if ! curl --location --silent --fail --remote-name $repo -o $jar; then | |
exit 1 | |
fi | |
fi | |
checksum=`openssl dgst -md5 $jar | awk '{ print $2 }'` | |
if [ "$checksum" != $md5 ]; then | |
echo "[error] Bad $PWD/$jar. Delete $PWD/$jar and run $0 again." | |
exit 1 | |
fi | |
java -ea \ | |
$JAVA_OPTS \ | |
-Xms512M \ | |
-Xmx1024M \ | |
-server \ | |
-jar $jar "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very handy 👍