Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/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