From ace9bf07c328e5a602f0bdc93ae64bdd5b90d2fa Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 29 Apr 2016 14:22:28 +0100 Subject: [PATCH] Test for gopath --- src/freedombone | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/freedombone b/src/freedombone index 7de969cd..092b535d 100755 --- a/src/freedombone +++ b/src/freedombone @@ -2638,13 +2638,18 @@ function create_mirrors { } function select_go_version { - if [ ! -d $HOME/.gvm/scripts ]; then - echo $'GVM was not installed' - exit 629532 - fi + if [ ! -d $HOME/.gvm/scripts ]; then + echo $'GVM was not installed' + exit 629532 + fi cd $HOME/.gvm/scripts gvm use go${GO_VERSION} --default - systemctl set-environment GOPATH=$GOPATH + systemctl set-environment GOPATH=$GOPATH + + if [ ${#GOPATH} -lt 2 ]; then + echo $'GOPATH was not set' + exit 629825 + fi } function mesh_cjdns_tools { @@ -2658,13 +2663,13 @@ function mesh_cjdns_tools { mesh_cjdns fi - select_go_version + select_go_version apt-get -y install golang mercurial if [ ! -f ~/.bashrc ]; then touch ~/.bashrc fi - + if [ ! -d /home/git ]; then # add a gogs user account adduser --disabled-login --gecos 'Gogs' git