mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-23 22:46:53 +00:00
Fix: stop installing golangci-lint each time (#2713)
When golangci-lint doesn't locate in $PATH, it will be installed in
$GOBIN every single time.
(cherry picked from commit bff846b7fe)
Co-authored-by: zzxwill <zzxwill@gmail.com>
This commit is contained in:
co-authored by
zzxwill
parent
9a0ea76210
commit
8a9df2dd39
@@ -275,16 +275,20 @@ HOSTARCH := amd64
|
||||
endif
|
||||
|
||||
golangci:
|
||||
ifeq (, $(shell which golangci-lint))
|
||||
ifneq ($(shell which golangci-lint),)
|
||||
@$(OK) golangci-lint is already installed
|
||||
GOLANGCILINT=$(shell which golangci-lint)
|
||||
else ifeq (, $(shell which $(GOBIN)/golangci-lint))
|
||||
@{ \
|
||||
set -e ;\
|
||||
echo 'installing golangci-lint-$(GOLANGCILINT_VERSION)' ;\
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) $(GOLANGCILINT_VERSION) ;\
|
||||
echo 'Install succeed' ;\
|
||||
echo 'Successfully installed' ;\
|
||||
}
|
||||
GOLANGCILINT=$(GOBIN)/golangci-lint
|
||||
else
|
||||
GOLANGCILINT=$(shell which golangci-lint)
|
||||
@$(OK) golangci-lint is already installed
|
||||
GOLANGCILINT=$(GOBIN)/golangci-lint
|
||||
endif
|
||||
|
||||
.PHONY: staticchecktool
|
||||
|
||||
Reference in New Issue
Block a user