Commits

Yoshifumi YAMAGUCHI committed e46c0a6

added a validation of existence of /opt/go and /opt/goenv

  • Participants
  • Parent commits 47ed268

Comments (0)

Files changed (2)

 2. Install
 ==========
 
+2.0 pre-requirements
+--------------------
+
+* In advance of using installation scripts, please make sure your ``$GOENVGOROOT`` and ``$GOENVTARGET`` exist and those permissions are correctly set.
+
+* Make sure ``git`` and ``mercurial`` are installed.
+
 2.1 Fast installation
 ---------------------
 
 2.2 Go initial installation
 ---------------------------
 
-If you're fine with installing Go from the source code and goenv at the same time, use initial-install.sh::
-
-   $ curl -L https://bitbucket.org/ymotongpoo/goenv/raw/master/shellscripts/initial-install.sh | bash
-
 You have to set following variables beforehand:
 
 * ``GOENVGOROOT``: Go binary install target. All Go binaries are installed under this directory. 
 * ``GOENVTARGET``: goenv install target. goenv and goenvwrapper.sh are installed here.
 * ``GOENVHOME``: All workspaces created with ``goof`` command are here.
 
+If you're fine with installing Go from the source code and goenv at the same time, use initial-install.sh::
+
+   $ curl -L https://bitbucket.org/ymotongpoo/goenv/raw/master/shellscripts/initial-install.sh | bash
 
 3. Usage
 ========

shellscripts/initial-install.sh

   exit 0
 fi
 
+if [ ! -d "$GOENVGOROOT" ]; then
+  if eval "mkdir $GOENVGOROOT"; then
+    echo "[goenv] please confirm directory permission for GOENVGOROOT"      
+    exit 0
+  fi
+fi
+
+if [ ! -d "$GOENVTARGET" ]; then
+  if eval "mkdir $GOENVTARGET"; then
+    echo "[goenv] please confirm directory permission for GOENVTARGET"      
+    exit 0
+  fi
+fi
+
 cd /tmp
 
 downloader=""
   exit 0
 fi
 
-if $downloader "https://bitbucket.org/ymotongpoo/goenv/raw/master/shellscripts/goenvwrapper.sh"; then
+if eval "$downloader https://bitbucket.org/ymotongpoo/goenv/raw/master/shellscripts/goenvwrapper.sh"; then
   if [ -f "goenvwrapper.sh" ]; then
     source goenvwrapper.sh
   else