From 4e5c4df098c489097613d6324844467006d44890 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Wed, 18 Sep 2019 14:03:18 -0700 Subject: [PATCH] Makefile: remove side-effects to go.mod when installing all deps This commit applies the same cd /tmp prefix to installations for all dependencies. It also corrects the previous behavior, which requires the cd /tmp to be in the same command, and not separate statements. --- Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index ad729f7d..53da4d63 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,7 @@ BTCD_COMMIT := $(shell cat go.mod | \ GOACC_COMMIT := ddc355013f90fea78d83d3a6c71f1d37ac07ecd5 +DEPGET := cd /tmp && GO111MODULE=on go get -v GOBUILD := GO111MODULE=on go build -v -trimpath GOINSTALL := GO111MODULE=on go install -v -trimpath GOTEST := GO111MODULE=on go test -v @@ -71,18 +72,15 @@ $(GOVERALLS_BIN): $(LINT_BIN): @$(call print, "Fetching linter") - # Switch to tmp directory to prevent lnd go.mod from being modified. - # Hopefully someday a flag for go get will be added for this. - cd /tmp - GO111MODULE=on go get -v $(LINT_PKG) + $(DEPGET) $(LINT_PKG) $(GOACC_BIN): @$(call print, "Fetching go-acc") - GO111MODULE=on go get -v $(GOACC_PKG)@$(GOACC_COMMIT) + $(DEPGET) $(GOACC_PKG)@$(GOACC_COMMIT) btcd: @$(call print, "Installing btcd.") - GO111MODULE=on go get -v $(BTCD_PKG)@$(BTCD_COMMIT) + $(DEPGET) $(BTCD_PKG)@$(BTCD_COMMIT) # ============ # INSTALLATION