Last active
August 29, 2015 14:22
-
-
Save fuzzy/e0a075b5c5034f471358 to your computer and use it in GitHub Desktop.
bootstrap for go1.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| go14src=https://storage.googleapis.com/golang/go1.4.2.src.tar.gz | |
| go14fnm=$(basename ${go14src}) | |
| bootstrap() { | |
| cd /tmp | |
| wget ${go14src} | |
| tar zxf ${go14fnm} | |
| cd /tmp/go/src | |
| ./make.bash | |
| } | |
| # Do we have a go at all? | |
| test ! -z "$(which go 2>/dev/null)" && go=$(which go) | |
| # And if so, is it | |
| (test -z "${go}" || test -z "$(${go} version|grep go1.4)") && bootstrap | |
| cd ~ | |
| mkdir -p ~/.godev/$(uname -s)/$(uname -m)/gopath | |
| cd ~/.godev/$(uname -s)/$(uname -m) | |
| git clone https://github.com/golang/go.git goroot | |
| cd goroot/src | |
| env GOROOT_BOOTSTRAP=/tmp/go ./make.bash || exit 1 | |
| rm -rf /tmp/${go14fnm} /tmp/go | |
| echo "You will want to add the following to your ~/.profile or ~/.bashrc or whatever." | |
| echo "export PATH=\${HOME}/.godev/\$(uname -s)/\$(uname -m)/goroot/bin:\${PATH}" | |
| echo "export GOROOT=\${HOME}/.godev/\$(uname -s)/\$(uname -m)/goroot" | |
| echo "export GOPATH=\${HOME}/.godev/\$(uname -s)/\$(uname -m)/gopath" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment