Browse Source

Test for gopath

Bob Mottram 9 years ago
parent
commit
ace9bf07c3
No account linked to committer's email
1 changed files with 12 additions and 7 deletions
  1. 12
    7
      src/freedombone

+ 12
- 7
src/freedombone View File

2638
 }
2638
 }
2639
 
2639
 
2640
 function select_go_version {
2640
 function select_go_version {
2641
-	if [ ! -d $HOME/.gvm/scripts ]; then
2642
-		echo $'GVM was not installed'
2643
-		exit 629532
2644
-	fi
2641
+    if [ ! -d $HOME/.gvm/scripts ]; then
2642
+        echo $'GVM was not installed'
2643
+        exit 629532
2644
+    fi
2645
     cd $HOME/.gvm/scripts
2645
     cd $HOME/.gvm/scripts
2646
     gvm use go${GO_VERSION} --default
2646
     gvm use go${GO_VERSION} --default
2647
-    systemctl set-environment GOPATH=$GOPATH	
2647
+    systemctl set-environment GOPATH=$GOPATH
2648
+
2649
+    if [ ${#GOPATH} -lt 2 ]; then
2650
+        echo $'GOPATH was not set'
2651
+        exit 629825
2652
+    fi
2648
 }
2653
 }
2649
 
2654
 
2650
 function mesh_cjdns_tools {
2655
 function mesh_cjdns_tools {
2658
         mesh_cjdns
2663
         mesh_cjdns
2659
     fi
2664
     fi
2660
 
2665
 
2661
-	select_go_version
2666
+    select_go_version
2662
 
2667
 
2663
     apt-get -y install golang mercurial
2668
     apt-get -y install golang mercurial
2664
     if [ ! -f ~/.bashrc ]; then
2669
     if [ ! -f ~/.bashrc ]; then
2665
         touch ~/.bashrc
2670
         touch ~/.bashrc
2666
     fi
2671
     fi
2667
-	
2672
+    
2668
     if [ ! -d /home/git ]; then
2673
     if [ ! -d /home/git ]; then
2669
         # add a gogs user account
2674
         # add a gogs user account
2670
         adduser --disabled-login --gecos 'Gogs' git
2675
         adduser --disabled-login --gecos 'Gogs' git