From abae65d8f1cac3a5ceefbb3601ba7610a2ae52e6 Mon Sep 17 00:00:00 2001 From: Li Zhijian Date: Wed, 10 Feb 2021 14:06:29 +0800 Subject: [PATCH] cmd: set proper GOBIN Signed-off-by: Li Zhijian --- cmd/config/Makefile | 5 ++++- cmd/gorepomod/Makefile | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/config/Makefile b/cmd/config/Makefile index 9a8b01d07..4c40e8b85 100644 --- a/cmd/config/Makefile +++ b/cmd/config/Makefile @@ -3,7 +3,10 @@ .PHONY: generate license fix vet fmt test build tidy clean -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif $(GOBIN)/addlicense: go get github.com/google/addlicense diff --git a/cmd/gorepomod/Makefile b/cmd/gorepomod/Makefile index c85352386..49dad0752 100644 --- a/cmd/gorepomod/Makefile +++ b/cmd/gorepomod/Makefile @@ -1,4 +1,7 @@ -MYGOBIN := $(shell go env GOPATH)/bin +MYGOBIN = $(shell go env GOBIN) +ifeq ($(MYGOBIN),) +MYGOBIN = $(shell go env GOPATH)/bin +endif $(MYGOBIN)/gorepomod: usage.go go install .