Added script to confirm API docs up-to-date.

This commit is contained in:
Patrick Connolly
2018-11-05 16:49:58 +08:00
parent b8f9e2ff3a
commit c97ecb2a7f
2 changed files with 12 additions and 1 deletions

10
ci/check_swagger_sync.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
$GOPATH/bin/swag init --generalInfo bridge/api/api.go --dir . 2> /dev/null
# When regenerated, only a single date line changes.
# A minimal one-line diff shows as two operations (addition + subtraction),
# with 7 lines in the diff output
if [ "$(git diff --unified=0 | wc -l)" -gt 7 ]; then
exit 1
fi