Skip to content

Commit abe3384

Browse files
janiszraadfhaddad
andcommitted
fix: remove darwin shell hack in Makefile
Co-authored-by: Raad Haddad <[email protected]> Signed-off-by: Tomasz Janiszewski <[email protected]>
1 parent 2d94898 commit abe3384

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

Makefile

+7-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
2-
.PHONY: none
3-
none:
4-
5-
1+
.PHONY: deps
62
deps: go.mod go.sum
73
@echo "+ $@"
84
@go mod tidy
@@ -22,12 +18,6 @@ GOBIN := $(CURDIR)/.gobin
2218
DIST := $(CURDIR)/dist
2319
PATH := $(DIST):$(GOBIN):$(PATH)
2420

25-
# Makefile on Mac doesn't pass the updated PATH and GOBIN to the shell
26-
# and so, without the following line, the shell does not end up
27-
# trying commands in $(GOBIN) first.
28-
# See https://stackoverflow.com/a/36226784/3690207
29-
SHELL := env GOBIN=$(GOBIN) PATH=$(PATH) /bin/bash
30-
3121
KUBE_LINTER_BIN := $(GOBIN)/kube-linter
3222

3323
COVFILES := $(shell mktemp -d)
@@ -39,12 +29,12 @@ COVFILES := $(shell mktemp -d)
3929
GOLANGCILINT_BIN := $(GOBIN)/golangci-lint
4030
$(GOLANGCILINT_BIN): deps
4131
@echo "+ $@"
42-
go install github.com/golangci/golangci-lint/cmd/golangci-lint
32+
GOBIN=$(GOBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint
4333

4434
GORELEASER_BIN := $(GOBIN)/goreleaser
4535
$(GORELEASER_BIN): deps
4636
@echo "+ $@"
47-
go install github.com/goreleaser/goreleaser
37+
GOBIN=$(GOBIN) go install github.com/goreleaser/goreleaser
4838

4939
###########
5040
## Lint ##
@@ -56,9 +46,9 @@ ifdef CI
5646
@echo '+ $@'
5747
@echo 'The environment indicates we are in CI; running linters in check mode.'
5848
@echo 'If this fails, run `make lint`.'
59-
golangci-lint run
49+
$(GOLANGCILINT_BIN) run
6050
else
61-
golangci-lint run --fix
51+
$(GOLANGCILINT_BIN) run --fix
6252
endif
6353

6454
.PHONY: lint
@@ -89,7 +79,8 @@ generated-srcs: go-generated-srcs generated-docs
8979
build: $(KUBE_LINTER_BIN)
9080

9181
$(KUBE_LINTER_BIN): $(GORELEASER_BIN) $(shell find . -type f -name '*.go')
92-
goreleaser build --snapshot --clean
82+
$(GORELEASER_BIN) build --snapshot --clean
83+
mkdir -p $(GOBIN)
9384
@cp "$(DIST)/kube-linter_$(HOST_OS)_amd64_v1/kube-linter" "$(GOBIN)/kube-linter"
9485
@chmod u+w "$(GOBIN)/kube-linter"
9586

0 commit comments

Comments
 (0)