-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4ad89d
commit 9fce482
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## help: print this help message | ||
.PHONY: help | ||
help: | ||
@echo "Usage:" | ||
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /' | ||
|
||
## audit: format, vet, and test code | ||
.PHONY: audit | ||
audit: | ||
@echo "Formatting code." | ||
gofumpt -w . | ||
@echo "Vetting code." | ||
go vet ./... | ||
staticcheck ./... | ||
@echo "Running tests." | ||
go test -race -vet=off ./... | ||
|
||
ver = $(shell git describe --always --dirty --tags --long) | ||
linker_flags = "-s -X 'tshaka.co/bat/internal/cli.ver=${ver}'" | ||
## build: build the cmd/bat application | ||
.PHONY: build | ||
build: | ||
@echo "Building bat." | ||
GOOS=linux GOARCH=amd64 go build -ldflags=${linker_flags} ./cmd/bat/ | ||
|
||
## release: package bat binary into a zip file | ||
.PHONY: release | ||
release: build | ||
@echo "Packaging bat." | ||
zip bat.zip ./bat |