Skip to content

Instantly share code, notes, and snippets.

@wonderbeyond
Created December 3, 2022 11:47
Show Gist options
  • Save wonderbeyond/86c29599f919264e148f43108f450160 to your computer and use it in GitHub Desktop.
Save wonderbeyond/86c29599f919264e148f43108f450160 to your computer and use it in GitHub Desktop.
Install the swagger-codegen-cli
#!/usr/bin/env bash
set -euo pipefail
PREFIX=${PREFIX:-~/.local}
mkdir -p $PREFIX/bin $PREFIX/lib
curl -L https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.36/swagger-codegen-cli-3.0.36.jar \
-o $PREFIX/lib/swagger-codegen-cli.jar
echo '#!/usr/bin/env bash' > $PREFIX/bin/swagger-codegen-cli
echo "java -jar $PREFIX/lib/swagger-codegen-cli.jar \"\$@\"" >> $PREFIX/bin/swagger-codegen-cli
chmod +x $PREFIX/bin/swagger-codegen-cli
echo "Installed at $PREFIX/bin/swagger-codegen-cli"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment