summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 688114fb3f..39afc0c007 100644
--- a/Makefile
+++ b/Makefile
@@ -5,9 +5,13 @@ export GO111MODULE=off
GO ?= go
SED_INPLACE := sed -i
SHASUM ?= shasum -a 256
-GOPATH ?= $(shell $(GO) env GOPATH)
+HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
+
+ifeq ($(HAS_GO), GO)
+ GOPATH ?= $(shell $(GO) env GOPATH)
+ export PATH := $(GOPATH)/bin:$(PATH)
+endif
-export PATH := $(GOPATH)/bin:$(PATH)
ifeq ($(OS), Windows_NT)
EXECUTABLE ?= gitea.exe