chore: use .env file in make tasks

This commit is contained in:
wpetit 2022-05-10 22:38:05 +02:00
parent b449e46f41
commit 9281685f09
2 changed files with 7 additions and 6 deletions

View File

@ -0,0 +1 @@
GITHUB_TOKEN=

View File

@ -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