Last active
January 28, 2016 08:58
-
-
Save goodjob1114/f91f42361fd13ce42f8c to your computer and use it in GitHub Desktop.
install-golang-by-gvm
This file contains 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/bash | |
case ${OSTYPE} in | |
linux-gnu) | |
r=$(lsb_release -si) | |
if [ $r == "Ubuntu" ] || [ $r == "Debian" ]; then | |
sudo apt-get install -y binutils bison gcc make git | |
else | |
echo "Not Ubuntu..." | |
fi | |
;; | |
darwin*) | |
echo "Hello MacOS" | |
;; | |
*) echo Unknown;; | |
esac | |
compiler="go1.4" | |
stable="go1.5.3" | |
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer); \ | |
source ~/.gvm/scripts/gvm && \ | |
gvm install $compiler && \ | |
gvm use $compiler && \ | |
gvm install $stable && \ | |
gvm use $stable --default | |
echo '' | |
echo 'Please restart your terminal session or to get started right away run' | |
echo '`source ~/.gvm/scripts/gvm`' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment