Skip to content

Commit

Permalink
build: add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
LucJosin committed Jul 19, 2024
1 parent 27f1127 commit dd54170
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Makefile
.DEFAULT_GOAL := help

# Colors
RED := $(shell tput -Txterm setaf 1)
GREEN := $(shell tput -Txterm setaf 2)
BLUE := $(shell tput -Txterm setaf 4)
CYAN := $(shell tput -Txterm setaf 6)
RESET := $(shell tput -Txterm sgr0)

## Commands

test: ## Run the pkg tests
@go test -v ./pkg/...

## Help

# https://gist.github.com/thomaspoignant/5b72d579bd5f311904d973652180c705
help: ## Show this help
@echo
@echo 'Usage:'
@echo ' ${CYAN}make${RESET} ${GREEN}<target>${RESET}'
@echo
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} { \
if (/[a-zA-Z_\-]+:.*?##.*$$/) {printf " ${CYAN}%-25s${GREEN}%s${RESET}\n", $$1, $$2} \
else if (/^## .*$$/) {printf " ${BLUE}%s${RESET}\n", substr($$1,4)} \
}' $(MAKEFILE_LIST)
@echo

0 comments on commit dd54170

Please sign in to comment.