From 2f34a664baafc784af83a3260b17285cc7fe78d9 Mon Sep 17 00:00:00 2001 From: spekulaas Date: Sat, 8 Oct 2022 01:18:47 +0200 Subject: [PATCH] golang fix --- src/importantinstalls/golang.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/importantinstalls/golang.sh b/src/importantinstalls/golang.sh index 17a6e76..acb0db6 100755 --- a/src/importantinstalls/golang.sh +++ b/src/importantinstalls/golang.sh @@ -13,13 +13,19 @@ latestversionsh=${latestversionsh%'">'*} # Download latest golang version sudo -u $SUDO_USER wget "https://go.dev"$latestversionsh +# Remove dashes from latest version string +latestversionsh=${latestversionsh#*'/'} +latestversionsh=${latestversionsh#*'/'} + # Remove any previous Go installation then extract the archive -rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.1.linux-amd64.tar.gz +rm -rf /usr/local/go && tar -C /usr/local -xzf $latestversionsh if [[ $(which zsh) == "/usr/bin/zsh" ]]; then sudo -u $SUDO_USER echo 'export PATH=$PATH:/usr/local/go/bin # This is the path to the Golang install' >> ~/.zshrc fi -sudo -u $SUDO_USER echo 'export PATH=$PATH:/usr/local/go/bin # This is the path to the Golang install' >> ~/.bashrc +cat >> ~/.bashrc << EOT +export PATH=$PATH:/usr/local/go/bin # This is the path to the Golang install +EOT source ~/.bashrc \ No newline at end of file