forked from heiko-braun/draft
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 830 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.PHONY: build install clean test fmt vet install-hooks sync-templates
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS := -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(DATE)"
sync-templates:
@./scripts/sync-templates.sh
build: sync-templates
go build $(LDFLAGS) -o bin/draft ./cmd/draft
install: sync-templates
go install $(LDFLAGS) ./cmd/draft
clean:
rm -rf bin/
rm -rf cmd/draft/templates/.claude/
rm -rf cmd/draft/templates/.cursor/
rm -rf cmd/draft/templates/specs/
test:
go test ./...
fmt:
go fmt ./...
vet:
go vet ./...
install-hooks:
./scripts/install-git-hooks.sh
run:
go run $(LDFLAGS) ./cmd/draft $(ARGS)