-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
27 lines (20 loc) · 810 Bytes
/
Makefile
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
default: test
PACKAGES:="./pkg/backup ./pkg/worker ./pkg/logger ./pkg/reporter"
test: vet
@go list -f '{{.Dir}}/test.cov {{.ImportPath}}' "$(PACKAGES)" \
| while read coverage package ; do go test -tags test -coverprofile "$$coverage" "$$package" ; done \
| awk -W interactive '{ print } /^FAIL/ { failures++ } END { exit failures }' ;
@go list -f '{{.Dir}}/test.cov' "$(PACKAGES)" \
| while read coverage ; do go tool cover -func "$$coverage" ; done \
| awk '$$3 !~ /^100/ { print; gaps++ } END { exit gaps }' ;
vet:
go vet ./...
run:
godotenv go run ./cmd/s3-personal-backup
build: clean
go build -o build/s3-personal-backup ./cmd/s3-personal-backup
cp build/s3-personal-backup s3-personal-backup
clean:
rm -rf build
rm -rf s3-personal-backup
.PHONY: default test vet build clean run