Skip to content

Commit e90fb70

Browse files
committed
Use go install and full path to commands
Signed-off-by: Brandon Mitchell <[email protected]>
1 parent b352bf8 commit e90fb70

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Makefile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ EPOCH_TEST_COMMIT ?= v0.2.0
33
DOCKER ?= $(shell command -v docker 2>/dev/null)
44
PANDOC ?= $(shell command -v pandoc 2>/dev/null)
55

6+
GOPATH:=$(shell go env GOPATH)
7+
68
OUTPUT_DIRNAME ?= output
79
DOC_FILENAME ?= oci-image-spec
810

@@ -87,7 +89,7 @@ check-license:
8789

8890
lint: .install.lint
8991
@echo "checking lint"
90-
@GO111MODULE=on golangci-lint run
92+
@GO111MODULE=on $(GOPATH)/bin/golangci-lint run
9193

9294
test: schema/fs.go
9395
go test -race -cover $(shell go list ./... | grep -v /vendor/)
@@ -100,18 +102,22 @@ img/%.png: img/%.dot
100102
.gitvalidation:
101103
@which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false)
102104
ifdef GITHUB_SHA
103-
git-validation -q -run DCO,short-subject,dangling-whitespace -range $(GITHUB_SHA)..HEAD
105+
$(GOPATH)/bin/git-validation -q -run DCO,short-subject,dangling-whitespace -range $(GITHUB_SHA)..HEAD
104106
else
105-
git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD
107+
$(GOPATH)/bin/git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD
106108
endif
107109

108110
install.tools: $(TOOLS:%=.install.%)
109111

110112
.install.lint:
111-
go get github.com/golangci/golangci-lint/cmd/[email protected]
113+
case "$$(go env GOVERSION)" in \
114+
go1.17.*) go install github.com/golangci/golangci-lint/cmd/[email protected];; \
115+
go1.18.*) go install github.com/golangci/golangci-lint/cmd/[email protected];; \
116+
*) go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest;; \
117+
esac
112118

113119
.install.gitvalidation:
114-
go get -u github.com/vbatts/git-validation
120+
go install github.com/vbatts/git-validation@latest
115121

116122
clean:
117123
rm -rf *~ $(OUTPUT_DIRNAME) header.html

0 commit comments

Comments
 (0)