1. michilu
  2. goenv

Commits

Yoshifumi YAMAGUCHI  committed e449292

changed to cd after build go

  • Participants
  • Parent commits e46c0a6
  • Branches develop

Comments (0)

Files changed (1)

File shellscripts/goenvwrapper.sh

View file
   fi
 
   # build and copy directory
-  local repo=$GOENVGOROOT/go
+  local repo="$GOENVGOROOT/go"
+  local oldpwd="$PWD"
   local init=1
   if [ -d "$GOENVGOROOT/$1" ]; then
     init=0
       echo "[goof] Go source code initial checkout."
       eval "hg clone -q https://code.google.com/p/go/ --cwd $GOENVGOROOT"
     fi
-    cd $repo
+    cd "$repo"
     if [ ! -d "$repo/logs" ]; then
       mkdir "$repo/logs"
     fi
       fi
     else
       echo "see build log file: $logfile"
+      cd "$oldpwd"
       return 1
     fi
   else
     echo "check tag name: $1"
   fi
+  cd "$oldpwd"
 }
 
 # goof_go changes current GOROOT in specified version