drone-pre-commit/scripts/add_golang.sh

21 lines
392 B
Bash
Raw Normal View History

2021-02-02 23:42:48 +00:00
#! /bin/bash
set -ex
2022-04-07 20:15:22 +00:00
VERSION=1.18
SHASUM=e85278e98f57cdb150fe8409e6e5df5343ecb13cebf03a5d5ff12bd55a80264f
2021-02-02 23:42:48 +00:00
FILENAME=go${VERSION}.linux-amd64.tar.gz
2022-04-07 20:15:22 +00:00
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"