local-server/vendor/github.com/mcluseau/go-swagger-ui/fetch-ui.sh

23 lines
503 B
Bash
Raw Normal View History

2019-02-04 02:56:43 +00:00
#! /bin/sh
v=3.20.6
file=v$v.tar.gz
2019-02-04 03:03:59 +00:00
set -ex
2019-02-04 02:56:43 +00:00
[ -e swagger-ui/$file ] ||
wget -P swagger-ui https://github.com/swagger-api/swagger-ui/archive/$file
rm -fr swagger-ui/dist
tar zxvf swagger-ui/$file --strip-components=1 -C swagger-ui swagger-ui-$v/dist
2019-02-04 03:14:00 +00:00
# remove stack trace support (heavy)
rm swagger-ui/dist/*.map
# remove unused files
rm swagger-ui/dist/swagger-ui.js
# set a better default URL
2019-02-04 03:03:59 +00:00
sed -i -e '/url:/s,https://petstore.swagger.io/v2/swagger.json,/swagger.json,g' swagger-ui/dist/*