-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (53 loc) · 1.74 KB
/
Makefile
File metadata and controls
70 lines (53 loc) · 1.74 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
CLI_NAME := metorial
BIN_DIR := bin
BIN := $(BIN_DIR)/$(CLI_NAME)
PKG := ./cmd/metorial
.PHONY: help build run fmt test tidy check install clean completion-bash completion-zsh completion-fish completion-powershell release snapshot public
help:
@printf "%s\n" \
"Available targets:" \
" make build Build the CLI into ./bin/metorial" \
" make run Run the CLI locally" \
" make fmt Format all Go code" \
" make test Run CLI tests" \
" make tidy Sync go.mod and go.sum" \
" make check Run fmt, tidy, and tests" \
" make install Install the CLI into GOPATH/bin" \
" make clean Remove local build output" \
" make completion-bash Print bash completions" \
" make completion-zsh Print zsh completions" \
" make completion-fish Print fish completions" \
" make completion-powershell Print PowerShell completions" \
" make public Build the static installer site into ./public" \
" make snapshot Build a Goreleaser snapshot" \
" make release Run Goreleaser release --clean"
build:
mkdir -p $(BIN_DIR)
go build -o $(BIN) $(PKG)
run:
go run $(PKG)
fmt:
gofmt -w $$(find . -name '*.go' -print)
test:
go test ./...
tidy:
go mod tidy
check: fmt tidy test
install:
go install $(PKG)
clean:
rm -rf $(BIN_DIR)
completion-bash:
go run $(PKG) completion bash
completion-zsh:
go run $(PKG) completion zsh
completion-fish:
go run $(PKG) completion fish
completion-powershell:
go run $(PKG) completion powershell
public:
bun ./scripts/build-public.ts
snapshot:
goreleaser release --clean --snapshot
release:
goreleaser release --clean