From 1e96c3806cac82b58e6bf8edb7bd1e0c7c71f503 Mon Sep 17 00:00:00 2001 From: Yevhen Pavlov Date: Wed, 9 Oct 2024 22:41:38 +0300 Subject: [PATCH] chore: Add more tools to Makefile (#16) --- Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a1e3305..31a475d 100644 --- a/Makefile +++ b/Makefile @@ -31,26 +31,31 @@ run-docker: ## test: Run unit tests .PHONY: test -test: +test: check-go @go test ./... # ------------------------------------------------------------------------------------------------- # tools && shared # ------------------------------------------------------------------------------------------------- +## tidy: Removes unused dependencies and adds missing ones +.PHONY: tidy +tidy: check-go + go mod tidy + ## get-deps: Download go dependencies .PHONY: get-deps -get-deps: +get-deps: check-go go mod download ## tools: Install github.com/a-h/templ/cmd/templ@latest .PHONY: tools -tools: +tools: check-go go install github.com/a-h/templ/cmd/templ@latest ## get-air: Install live reload server github.com/cosmtrek/air@latest .PHONY: get-air -get-air: +get-air: check-go go install github.com/cosmtrek/air@latest ## generate: Compile templ files @@ -63,6 +68,11 @@ generate: air: get-deps generate air +## check-go: Check that Go is installed +.PHONY: check-go +check-go: + @command -v go &> /dev/null || (echo "Please install GoLang" && false) + ## help: Display help .PHONY: help help: Makefile