drone-pre-commit/scripts/add_golang.sh

22 lines
411 B
Bash
Raw Normal View History

2021-02-02 23:42:48 +00:00
#! /bin/bash
set -ex
2023-10-26 21:26:46 +00:00
VERSION=1.21.3
ARCH=amd64
2023-04-18 23:25:17 +00:00
SHASUM=979694c2c25c735755bf26f4f45e19e64e4811d661dd07b8c010f7a8e18adfca
2021-02-02 23:42:48 +00:00
2023-10-26 21:26:46 +00:00
FILENAME="go${VERSION}.linux-${ARCH}.tar.gz"
GOURL="https://go.dev/dl/${FILENAME}"
2021-02-02 23:42:48 +00:00
wget --quiet "$GOURL"
# Check sum
echo "$SHASUM ./$FILENAME" > "${FILENAME}.sum"
shasum -c "./${FILENAME}.sum"
# Install
tar -C /usr/local -xzf "./$FILENAME"
# Clean up
rm "$FILENAME" "${FILENAME}.sum"