shoestrap/recipes/default/golang

14 lines
498 B
Plaintext
Raw Normal View History

2013-08-08 03:23:13 +00:00
#!/bin/bash
# Installs golang from the web
2013-08-08 03:23:13 +00:00
2021-12-03 01:06:33 +00:00
version="1.17.4"
ARCH=$(uname -m)
2013-08-08 03:23:13 +00:00
if [[ "$UNAME_STR" == "Darwin" ]]; then
2021-12-03 01:06:33 +00:00
wget -P "$TMP_DIR/" "http://golang.org/dl/go${version}.darwin-$ARCH.pkg"
sudo installer -target / -pkg "$TMP_DIR/go${version}.darwin-$ARCH.pkg"
2013-08-08 03:23:13 +00:00
elif [[ "$UNAME_STR" == "Linux" ]]; then
2021-12-03 01:06:33 +00:00
wget -P "$TMP_DIR/" "http://golang.org/dl/go${version}.linux-$ARCH.tar.gz"
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf "$TMP_DIR/go${version}.linux-$ARCH.tar.gz"
2013-08-08 03:23:13 +00:00
fi