From 6ce35caa5f14a98a3a1f0f6c672f0eb067ec72b9 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Tue, 17 Nov 2020 17:03:44 -0800 Subject: [PATCH] suppress error if go command not available on host --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5393ae2..e143339 100755 --- a/Makefile +++ b/Makefile @@ -35,8 +35,8 @@ ALL_PLATFORMS := linux/amd64 linux/arm linux/arm64 linux/ppc64le linux/s390x # Used internally. Users should pass GOOS and/or GOARCH. # hacked this to at least guess if go isn't installed on the host -OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS || uname -s | tr '[:upper:]' '[:lower:]')) -ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH || echo 'amd64')) +OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS 2>/dev/null || uname -s | tr '[:upper:]' '[:lower:]')) +ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH 2>/dev/null || echo 'amd64')) BASEIMAGE ?= scratch # gcr.io/distroless/static