Skip to content

Instantly share code, notes, and snippets.

@jimschubert
Last active March 26, 2018 01:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jimschubert/62baf653a9520b23399a67755c33631a to your computer and use it in GitHub Desktop.
Save jimschubert/62baf653a9520b23399a67755c33631a to your computer and use it in GitHub Desktop.
Quick script for running swagger codegen cli directly
#!/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 "$@"
@wing328
Copy link

wing328 commented Nov 10, 2017

Very handy 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment