From 10361a907acaa1126b27113789069a74ae7d5ccc Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 19 Feb 2017 20:14:46 +0100 Subject: [PATCH] build.bash: GOPATH may be unset since Go v1.8. Handle it. --- build.bash | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build.bash b/build.bash index fd3afb6..4cb04ed 100755 --- a/build.bash +++ b/build.bash @@ -4,8 +4,13 @@ set -eu cd "$(dirname "$0")" -# GOPATH may contain multiple paths separated by ":" -GOPATH1=$(echo $GOPATH | cut -f1 -d:) +# Starting with Go v1.8, GOPATH may be unset. $HOME/go is used instead. +if [[ -z ${GOPATH:-} ]] ; then + GOPATH1=$HOME/go +else + # GOPATH may contain multiple paths separated by ":" + GOPATH1=$(echo $GOPATH | cut -f1 -d:) +fi # gocryptfs version according to git GITVERSION=$(git describe --tags --dirty)