Skip to content

Commit

Permalink
Makefile: propose commit'ing generated files after make update-api
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Dec 9, 2024
1 parent 34b8c68 commit 8222fa3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ endif
@# Generate spec and exclude package from dependency which causes a 'classifier: unknown swagger annotation "extendee"' error.
@# For more details see: https://github.com/go-swagger/go-swagger/issues/2917.
swagger generate spec -o doc/rest-api.yaml -w ./lxd -m -x github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options
if [ -t 0 ] && ! git diff --quiet -- ./doc/rest-api.yaml; then \
read -rp "Would you like to commit swagger YAML changes (Y/n)? " answer; \
if [ "$${answer:-y}" = "y" ] || [ "$${answer:-y}" = "Y" ]; then \
git commit -S -sm "doc/rest-api: Refresh swagger YAML" -- ./doc/rest-api.yaml;\
fi;\
fi

.PHONY: update-metadata
update-metadata: build
Expand Down

0 comments on commit 8222fa3

Please sign in to comment.