Adjust spec tasks

This commit is contained in:
Jannis Mattheis 2018-02-27 19:57:28 +01:00 committed by Jannis Mattheis
parent 792d14ab04
commit 42c319c12c
1 changed files with 6 additions and 3 deletions

View File

@ -38,15 +38,18 @@ download-tools:
go get -u github.com/go-swagger/go-swagger/cmd/swagger go get -u github.com/go-swagger/go-swagger/cmd/swagger
go get github.com/karalabe/xgo go get github.com/karalabe/xgo
update-swagger: update-swagger-spec:
swagger generate spec --scan-models -o docs/spec.json swagger generate spec --scan-models -o docs/spec.json
check-swagger: update-swagger update-swagger: update-swagger-spec
(cd docs && packr)
check-swagger: update-swagger-spec
## add the docs to git, this changes line endings in git, otherwise this does not work on windows ## add the docs to git, this changes line endings in git, otherwise this does not work on windows
git add docs git add docs
if [ -n "$(shell git status --porcelain | grep docs)" ]; then \ if [ -n "$(shell git status --porcelain | grep docs)" ]; then \
git status --porcelain | grep docs; \ git status --porcelain | grep docs; \
echo Swagger or the Packr file is not up-to-date; \ echo Swagger Spec is not up-to-date; \
exit 1; \ exit 1; \
fi fi