Skip to content

Commit

Permalink
Check if go exists before generating the GOPATH (go-gitea#10100)
Browse files Browse the repository at this point in the history
* Check if go exists before generating the GOPATH

* Move export PATH into Go protected section

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
  • Loading branch information
zeripath and techknowlogick committed Feb 2, 2020
1 parent bcb52ae commit 391e063
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 391e063

Please sign in to comment.