Initial commit
This commit is contained in:
commit
3967e73347
196 files changed
+17768
No files matched your search
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
set -o nounset
|
||||
# set -o xtrace
|
||||
|
||||
GO_VERSION=1.24.1
|
||||
|
||||
remove_go() {
|
||||
rm -rf /usr/local/go
|
||||
rm -f /etc/profile.d/go.sh
|
||||
}
|
||||
|
||||
install_go() {
|
||||
remove_go
|
||||
ARCH=$(uname -m)
|
||||
|
||||
if [ "$ARCH" = "x86_64" ]; then
|
||||
ARCH="amd64"
|
||||
elif [ "$ARCH" = "aarch64" ]; then
|
||||
ARCH="arm64"
|
||||
else
|
||||
echo "Unsupported architecture: ${ARCH}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Installing Go ${GO_VERSION} for ${ARCH}"
|
||||
curl -sSfL https://go.dev/dl/go${GO_VERSION}.linux-${ARCH}.tar.gz | tar -C /usr/local -xz
|
||||
echo "Go ${GO_VERSION} installed successfully"
|
||||
echo "export PATH=\$PATH:/usr/local/go/bin" >> /etc/profile.d/go.sh
|
||||
}
|
||||
|
||||
install_go
|
||||
Reference in new issue
Block a user