From 9281685f09efbb8ce62fb4dda8d9f56f12a86094 Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 10 May 2022 22:38:05 +0200 Subject: [PATCH] chore: use .env file in make tasks --- .env.dist | 1 + Makefile | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.env.dist b/.env.dist index e69de29..0c6a33d 100644 --- a/.env.dist +++ b/.env.dist @@ -0,0 +1 @@ +GITHUB_TOKEN= \ No newline at end of file diff --git a/Makefile b/Makefile index 3853fa3..7e24985 100644 --- a/Makefile +++ b/Makefile @@ -6,15 +6,16 @@ TAILWINDCSS_ARGS ?= GORELEASER_VERSION ?= v1.8.3 GORELEASER_ARGS ?= --auto-snapshot --rm-dist GITCHLOG_ARGS ?= +SHELL := /bin/bash .PHONY: help help: ## Display this help @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -watch: ## Watching updated files - live reload - go run -mod=readonly github.com/cortesi/modd/cmd/modd@latest +watch: deps ## Watching updated files - live reload + ( set -o allexport && source .env && set +o allexport && go run -mod=readonly github.com/cortesi/modd/cmd/modd@latest ) -test: .env ## Executing tests +test: deps ## Executing tests ( set -o allexport && source .env && set +o allexport && go test -v -race -count=1 $(GOTEST_ARGS) ./... ) lint: ## Lint sources code @@ -35,19 +36,18 @@ internal/server/assets/dist/main.css: tailwind cp .env.dist .env .PHONY: deps -deps: node_modules +deps: .env node_modules node_modules: npm ci .PHONY: release release: deps - VERSION=$(GORELEASER_VERSION) curl -sfL https://goreleaser.com/static/run | bash /dev/stdin $(GORELEASER_ARGS) + ( set -o allexport && source .env && set +o allexport && VERSION=$(GORELEASER_VERSION) curl -sfL https://goreleaser.com/static/run | bash /dev/stdin $(GORELEASER_ARGS) ) .PHONY: changelog changelog: go run -mod=readonly github.com/git-chglog/git-chglog/cmd/git-chglog@v0.15.1 $(GITCHLOG_ARGS) - install-git-hooks: git config core.hooksPath .githooks \ No newline at end of file