diff options
author | zeripath <art27@cantab.net> | 2020-02-02 02:43:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-01 21:43:35 -0500 |
commit | 391e0638cc075b3aa9d526f7a40f86bc2222e57b (patch) | |
tree | e9a04dec71222bcbcee34290c67c99004e9ffec2 /Makefile | |
parent | bcb52aef09160c1057baa97b9275e8fb63587b12 (diff) | |
download | gitea-391e0638cc075b3aa9d526f7a40f86bc2222e57b.tar.gz gitea-391e0638cc075b3aa9d526f7a40f86bc2222e57b.zip |
Check if go exists before generating the GOPATH (#10100)
* Check if go exists before generating the GOPATH
* Move export PATH into Go protected section
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |