-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (28 loc) · 758 Bytes
/
Makefile
File metadata and controls
35 lines (28 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## personal dev is on macOS, but this should be
## supporting Linux as well
## gfind can be installed with `brew install findutils`
UNAME := $(shell uname)
ifeq ($(UNAME),Linux)
FIND_BIN=find
endif
ifeq ($(UNAME),Darwin)
FIND_BIN=gfind
endif
# .SHELLFLAGS = -ec
.ONESHELL:
build: ./bin/pokeapi-cli
./bin/pokeapi-cli: $(shell $(FIND_BIN) -name "*.go")
go build -o ./bin/pokeapi-cli
.PHONY: tidy
tidy:
go mod tidy
.PHONY: run
run:
PA_POKEAPI_POKEDEX_URL="https://pokeapi.co/api/v2/pokedex" \
./bin/pokeapi-cli
./bin/gotestsum:
GOBIN=$(PWD)/bin go install gotest.tools/gotestsum@latest
.PHONY: test
test: ./bin/gotestsum
PA_POKEAPI_POKEDEX_URL="https://pokeapi.co/api/v2/pokedex" \
./bin/gotestsum --format testname -- -tags test ./... -count=1