mirror of
https://github.com/unmojang/drasl.git
synced 2025-09-07 22:25:03 -04:00
Use 'go run' for swag in Makefile if not on PATH
This commit is contained in:
parent
7578349442
commit
0460a72121
5
Makefile
5
Makefile
@ -1,11 +1,14 @@
|
|||||||
prefix ?= /usr
|
prefix ?= /usr
|
||||||
.DEFAULT_GOAL := build
|
.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:
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
swag:
|
swag:
|
||||||
swag init --generalInfo api.go --output . --outputTypes json
|
$(SWAG) init --generalInfo api.go --output . --outputTypes json
|
||||||
|
|
||||||
prebuild: npm-install swag
|
prebuild: npm-install swag
|
||||||
node esbuild.config.js
|
node esbuild.config.js
|
||||||
|
@ -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 apt install make golang gcc nodejs npm # Debian
|
||||||
sudo dnf install make golang gcc nodejs npm # Fedora
|
sudo dnf install make golang gcc nodejs npm # Fedora
|
||||||
sudo pacman -S make go gcc nodejs npm # Arch Linux
|
sudo pacman -S make go gcc nodejs npm # Arch Linux
|
||||||
|
|
||||||
go install github.com/swaggo/swag/cmd/swag@latest
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then build the program with:
|
Then build the program with:
|
||||||
|
@ -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 apt install make golang gcc nodejs npm # Debian
|
||||||
sudo dnf install make golang gcc nodejs npm # Fedora
|
sudo dnf install make golang gcc nodejs npm # Fedora
|
||||||
sudo pacman -S make go gcc nodejs npm # Arch Linux
|
sudo pacman -S make go gcc nodejs npm # Arch Linux
|
||||||
|
|
||||||
go install github.com/swaggo/swag/cmd/swag@latest
|
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Clone the repository:
|
2. Clone the repository:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user