18 lines
541 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
2023-01-25 16:02:55 -08:00
version="1.19"
2021-12-02 17:06:33 -08:00
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
ARCH=amd64
fi
2013-08-07 20:23:13 -07:00
if [[ "$UNAME_STR" == "Darwin" ]]; then
wget -P "$TMP_DIR/" "https://go.dev/dl/go${version}.darwin-$ARCH.pkg"
2021-12-02 17:06:33 -08:00
sudo installer -target / -pkg "$TMP_DIR/go${version}.darwin-$ARCH.pkg"
2013-08-07 20:23:13 -07:00
elif [[ "$UNAME_STR" == "Linux" ]]; then
wget -P "$TMP_DIR/" "https://go.dev/dl/go${version}.linux-$ARCH.tar.gz"
2021-12-02 17:06:33 -08:00
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf "$TMP_DIR/go${version}.linux-$ARCH.tar.gz"
2013-08-07 20:23:13 -07:00
fi