Skip to content

Instantly share code, notes, and snippets.

@ToQoz
Created April 12, 2017 03:11
Show Gist options
  • Save ToQoz/cfb3b3c4cdd026c4f196bd908c6c7df6 to your computer and use it in GitHub Desktop.
Save ToQoz/cfb3b3c4cdd026c4f196bd908c6c7df6 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ -z "$1" ]; then
echo "usage: preview <swagger.yml path>"
exit 1
fi
tmpdir=$(mktemp -d /tmp/swagger-mode-tmp.XXXXXXXXXX)
swagger-codegen generate -i $1 -l html2 -o $tmpdir
open $tmpdir/index.html
sleep 3
rm -rf $tmpdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment