diff --git a/Makefile b/Makefile index de15f36..1903772 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,14 @@ prefix ?= /usr .DEFAULT_GOAL := build +# TODO probably use `go tool` for this eventually +SWAG := $(shell command -v swag || echo 'go run github.com/swaggo/swag/cmd/swag@v1.16.4') + npm-install: npm install swag: - swag init --generalInfo api.go --output . --outputTypes json + $(SWAG) init --generalInfo api.go --output . --outputTypes json prebuild: npm-install swag node esbuild.config.js diff --git a/README.md b/README.md index 4893172..c548977 100644 --- a/README.md +++ b/README.md @@ -91,8 +91,6 @@ Otherwise, install build dependencies. Go 1.19 or later is required: sudo apt install make golang gcc nodejs npm # Debian sudo dnf install make golang gcc nodejs npm # Fedora sudo pacman -S make go gcc nodejs npm # Arch Linux - -go install github.com/swaggo/swag/cmd/swag@latest ``` Then build the program with: diff --git a/doc/installation.md b/doc/installation.md index e6fd3dc..c3a1e08 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -140,8 +140,6 @@ This is a more declarative version of the Docker setup from above. sudo apt install make golang gcc nodejs npm # Debian sudo dnf install make golang gcc nodejs npm # Fedora sudo pacman -S make go gcc nodejs npm # Arch Linux - - go install github.com/swaggo/swag/cmd/swag@latest ``` 2. Clone the repository: