tangled mirror of catsky-馃惐 Soothing soft social-app fork with all the niche toggles! (Unofficial); for issues and PRs please put them on github:NekoDrone/catsky-social
1
2SHELL = /bin/bash
3.SHELLFLAGS = -o pipefail -c
4
5# https://github.com/golang/go/wiki/LoopvarExperiment
6export GOEXPERIMENT := loopvar
7
8.PHONY: help
9help: ## Print info about all commands
10 @echo "Commands:"
11 @echo
12 @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[01;32m%-20s\033[0m %s\n", $$1, $$2}'
13
14.PHONY: build
15build: ## Build all executables
16 go build ./cmd/bskyweb
17 go build ./cmd/embedr
18
19.PHONY: test
20test: ## Run all tests
21 go test ./...
22
23.PHONY: coverage-html
24coverage-html: ## Generate test coverage report and open in browser
25 go test ./... -coverpkg=./... -coverprofile=test-coverage.out
26 go tool cover -html=test-coverage.out
27
28.PHONY: lint
29lint: ## Verify code style and run static checks
30 go vet ./...
31 test -z $(gofmt -l ./...)
32
33.PHONY: fmt
34fmt: ## Run syntax re-formatting (modify in place)
35 go fmt ./...
36
37.PHONY: check
38check: ## Compile everything, checking syntax (does not output binaries)
39 go build ./...
40
41.env:
42 if [ ! -f ".env" ]; then cp example.dev.env .env; fi
43
44.PHONY: run-dev-bskyweb
45run-dev-bskyweb: .env ## Runs 'bskyweb' for local dev
46 GOLOG_LOG_LEVEL=info go run ./cmd/bskyweb serve
47
48.PHONY: run-dev-embedr
49run-dev-embedr: .env ## Runs 'embedr' for local dev
50 GOLOG_LOG_LEVEL=info go run ./cmd/embedr serve