fixes and cleanup
[webi-installers/.git] / golang / golang.bash
index a53c97ad28dd298d47d383bd424f1168ca3c2fc6..ad14c15d740cbd25997d6b91c69a5abd0f017a22 100644 (file)
@@ -50,16 +50,16 @@ WEBI_TMP=${WEBI_TMP:-"$(mktemp -d -t webinstall-go.XXXXXXXX)"}
 # The WEBI bootstrap will define these
 # but each script should be testable in its own right
 
-if [ -z "${WEBI_PKG_URL}" ]; then
-  release_tab="${WEBI_HOST}/api/releases/go@${WEBI_VERSION:-}.csv?os=$(uname -s)&arch=$(uname -m)&ext=tar&limit=1"
+if [ -z "${WEBI_PKG_URL:-}" ]; then
+  release_tab="${WEBI_HOST}/api/releases/golang@${WEBI_VERSION:-}.csv?os=$(uname -s)&arch=$(uname -m)&ext=tar&limit=1"
   WEBI_CSV=$(curl -fsSL "$release_tab" -H "User-Agent: $(uname -a)")
-  WEBI_CHANNEL=$(echo $WEBI_TAB | cut -d ',' -f 3)
+  WEBI_CHANNEL=$(echo $WEBI_CSV | cut -d ',' -f 3)
   if [ "error" == "$WEBI_CHANNEL" ]; then
      echo "could not find release for go v${WEBI_VERSION}"
      exit 1
   fi
-  WEBI_VERSION=$(echo $WEBI_TAB | cut -d ',' -f 1)
-  WEBI_PKG_URL=$(echo $WEBI_TAB | cut -d ',' -f 9)
+  WEBI_VERSION=$(echo $WEBI_CSV | cut -d ',' -f 1)
+  WEBI_PKG_URL=$(echo $WEBI_CSV | cut -d ',' -f 9)
   WEBI_PKG_FILE="$WEBI_TMP/$(echo $WEBI_PKG_URL | sed s:.*/::)"
 fi
 
@@ -117,7 +117,7 @@ popd 2>&1 >/dev/null
 ###################
 
 # TODO get better output from pathman / output the path to add as return to webi bootstrap
-pathman add "$new_go_home"
-pathman add "$HOME/go/bin/"
+pathman add "$new_go_home/bin"
+pathman add "$HOME/go/bin"
 echo "Installed 'go' (and go tools)"
 echo ""