13 lines
481 B
Plaintext
Raw Normal View History

2013-08-07 20:23:13 -07:00
#!/bin/bash
# Installs golang from the web
2013-08-07 20:23:13 -07:00
2021-10-25 13:57:10 -07:00
version="1.17.2"
2013-08-07 20:23:13 -07:00
if [[ "$UNAME_STR" == "Darwin" ]]; then
2021-10-22 17:02:25 -07:00
wget -P "$TMP_DIR/" "http://golang.org/dl/go${version}.darwin-amd64.pkg"
2021-10-25 13:57:10 -07:00
sudo installer -target / -pkg "$TMP_DIR/go${version}.darwin-amd64.pkg"
2013-08-07 20:23:13 -07:00
elif [[ "$UNAME_STR" == "Linux" ]]; then
wget -P "$TMP_DIR/" "http://golang.org/dl/go${version}.linux-amd64.tar.gz"
2021-07-25 18:43:12 -07:00
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf "$TMP_DIR/go${version}.linux-amd64.tar.gz"
2013-08-07 20:23:13 -07:00
fi