-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
49 lines (32 loc) · 773 Bytes
/
Justfile
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
default: check
## Main Commands
build: fmt clean test build-osx build-linux build-win
clean: clean-bin tidy
## Supporting Commands
tidy:
go mod tidy
fmt: tidy
trunk fmt
fmt-all: tidy
trunk fmt --all
check: fmt
trunk check
check-all: fmt-all
trunk check --all
test:
go test ./pkg/... ./lib/...
clean-bin:
rm -f bin/*
update: tidy
go get -u
trunk upgrade
## Build sub-commands
build-osx:
GOOS=darwin GOARCH=amd64 go build -o "bin/$(basename ${PWD})-osx" ./main.go
build-linux:
GOOS=linux GOARCH=amd64 go build -o "bin/$(basename ${PWD})-linux" ./main.go
build-win:
GOOS=windows GOARCH=amd64 go build -o "bin/$(basename ${PWD}).exe" ./main.go
## Git Hooks
pre-commit: clean check test
git add go.mod go.sum