forked from twpayne/chezmoi
/
Makefile
69 lines (56 loc) · 1.6 KB
/
Makefile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.PHONY: smoketest
smoketest:
go run . --version
go test ./...
./bin/golangci-lint run
all: completions generate
.PHONY: completions
completions: \
completions/chezmoi-completion.bash \
completions/chezmoi.fish \
completions/chezmoi.zsh
.PHONY: completions/chezmoi-completion.bash
completions/chezmoi-completion.bash:
mkdir -p $$(dirname $@) && go run . completion bash > $@ || ( rm -f $@ ; false )
.PHONY: completions/chezmoi.fish
completions/chezmoi.fish:
mkdir -p $$(dirname $@) && go run . completion fish > $@ || ( rm -f $@ ; false )
.PHONY: completions/chezmoi.zsh
completions/chezmoi.zsh:
mkdir -p $$(dirname $@) && go run . completion zsh > $@ || ( rm -f $@ ; false )
.PHONY: format
format:
find . -name \*.go | xargs $$(go env GOPATH)/bin/gofumports -w
.PHONY: generate
generate:
go generate ./...
$$(go env GOPATH)/bin/packr2
.PHONY: install-tools
install-tools:
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- v1.22.2
GO111MODULE=off go get -u \
github.com/gobuffalo/packr/v2/packr2 \
mvdan.cc/gofumpt/gofumports
.PHONY: lint
lint:
./bin/golangci-lint run
.PHONY: release
release:
goreleaser release \
--rm-dist \
${GORELEASER_FLAGS}
.PHONY: test-release
test-release:
goreleaser release \
--rm-dist \
--skip-publish \
--snapshot \
${GORELEASER_FLAGS}
.PHONY: test
test:
go test -race ./...
.PHONY: update-install.sh
update-install.sh:
# FIXME install.sh is generated by godownloader, but godownloader is
# currently unmaintained and needs to be run manually:
# godownloader --repo=twpayne/chezmoi .goreleaser.yaml > scripts/install.sh