0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 09:24:20 +01:00

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>
This commit is contained in:
zeripath 2020-02-02 02:43:35 +00:00 committed by GitHub
parent bcb52aef09
commit 391e0638cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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