build: dont install swag if already present

This commit is contained in:
Harvey Tindall
2023-06-27 07:23:25 +01:00
parent f72960635d
commit e1292a0780
4 changed files with 78 additions and 29 deletions

View File

@@ -88,6 +88,11 @@ else
NPMOPTS :=
endif
ifeq (, $(shell which swag))
SWAGINSTALL := $(GOBINARY) install github.com/swaggo/swag/cmd/swag@latest
else
SWAGINSTALL :=
endif
npm:
$(info installing npm dependencies)
@@ -122,7 +127,7 @@ typescript:
$(COPYTS)
swagger:
$(GOBINARY) install github.com/swaggo/swag/cmd/swag@latest
$(SWAGINSTALL)
swag init -g main.go
compile: