diff --git a/Makefile b/Makefile index 6c605db70..e5451a06a 100644 --- a/Makefile +++ b/Makefile @@ -284,16 +284,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