12345678910111213141516171819202122232425262728293031323334 |
- #!/bin/bash
- set -o errexit -o pipefail
- [[ "$GOROOT" ]] || export GOROOT="$HOME/golang"
- [[ "$GOPATH" ]] || export GOPATH="$HOME/go"
- PKG_VER="1.4.2"
- gimme \
- curl \
- git \
- mercurial
- if ! has go; then
- if [[ "$OS" = "Darwin" ]]; then
- #TODO: finish getting this working in atom w/ go-plus ... maybe just use binary from site like in Linux
- gimme_pkg go --cross-compile-common
- else
- if ! [[ -d "$GOROOT" ]]; then
- PKG_URL="https://storage.googleapis.com/golang/go${PKG_VER}.linux-amd64.tar.gz"
- mkdir -p "$GOROOT.$PKG_VER"
- curl -k -fsSL "$PKG_URL" | tar -xz -C "$GOROOT.$PKG_VER"
- mv -v "$GOROOT.$PKG_VER/go" "$GOROOT"
- rm -fr "$GOROOT.$PKG_VER"
- else
- echo "# FAIL: Unable to install 'go' to the GOROOT=$GOROOT directory because it already exists."
- exit 123
- fi
- fi
- fi
|