golang fix
This commit is contained in:
parent
d85ea6c5d4
commit
2f34a664ba
@ -13,13 +13,19 @@ latestversionsh=${latestversionsh%'">'*}
|
|||||||
# Download latest golang version
|
# Download latest golang version
|
||||||
sudo -u $SUDO_USER wget "https://go.dev"$latestversionsh
|
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
|
# 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
|
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
|
sudo -u $SUDO_USER echo 'export PATH=$PATH:/usr/local/go/bin # This is the path to the Golang install' >> ~/.zshrc
|
||||||
fi
|
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
|
source ~/.bashrc
|
Loading…
x
Reference in New Issue
Block a user