From 78000c01914a0ec649ca2557b0791f6bc335204e Mon Sep 17 00:00:00 2001 From: paul cannon Date: Tue, 22 Oct 2019 18:44:13 +0900 Subject: [PATCH] Makefile: handle empty/default $GOPATH (#3333) Use `$(CURDIR)` in place of `$(shell pwd)`. This saves a fork+exec, is more readable, and is more idiomatic. The only case where those should have different values is when someone's configured `$SHELL` is badly broken, and I'd argue in that case `$(CURDIR)` is preferable. Change-Id: I6a3abac1e2e197f5332825ffad2bbd3da1fc4700 --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c1c779c36..b07e6bddf 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ GO_VERSION ?= 1.13.3 GOOS ?= linux GOARCH ?= amd64 +GOPATH ?= $(shell go env GOPATH) COMPOSE_PROJECT_NAME := ${TAG}-$(shell git rev-parse --abbrev-ref HEAD) BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD | sed "s!/!-!g") ifeq (${BRANCH_NAME},master) @@ -372,7 +373,7 @@ diagrams-graphml: update-satellite-config-lock: ## Update the satellite config lock file @docker run -ti --rm \ -v ${GOPATH}/pkg/mod:/go/pkg/mod \ - -v $(shell pwd):/storj \ + -v ${CURDIR}:/storj \ -v $(shell go env GOCACHE):/go-cache \ -e "GOCACHE=/go-cache" \ -u root:root \