mirror of
https://github.com/ViViDboarder/shoestrap.git
synced 2025-01-03 03:07:42 +00:00
Avoid reinstall of golang
This commit is contained in:
parent
cf5cdb8186
commit
17d8e71664
@ -75,7 +75,10 @@ if [ "$(uname)" == 'Darwin' ]; then
|
|||||||
fi
|
fi
|
||||||
recipe 'git'
|
recipe 'git'
|
||||||
recipe 'vim-settings'
|
recipe 'vim-settings'
|
||||||
recipe 'golang'
|
if ! is_installed 'golang'; then
|
||||||
|
recipe 'golang'
|
||||||
|
set_installed 'golang'
|
||||||
|
fi
|
||||||
recipe 'fish'
|
recipe 'fish'
|
||||||
if $install_ui_terms ; then
|
if $install_ui_terms ; then
|
||||||
recipe 'alacritty'
|
recipe 'alacritty'
|
||||||
|
@ -2,16 +2,25 @@
|
|||||||
|
|
||||||
# Installs golang from the web
|
# Installs golang from the web
|
||||||
|
|
||||||
version="1.19"
|
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
if [ "$ARCH" = "x86_64" ]; then
|
if [ "$ARCH" = "x86_64" ]; then
|
||||||
ARCH=amd64
|
ARCH=amd64
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$UNAME_STR" == "Darwin" ]]; then
|
function install_go() {
|
||||||
wget -P "$TMP_DIR/" "https://go.dev/dl/go${version}.darwin-$ARCH.pkg"
|
local version="1.20.2"
|
||||||
sudo installer -target / -pkg "$TMP_DIR/go${version}.darwin-$ARCH.pkg"
|
if command -v "go" > /dev/null 2>&1 && go version | grep "$version"; then
|
||||||
elif [[ "$UNAME_STR" == "Linux" ]]; then
|
echo "Go version $version is already installed"
|
||||||
wget -P "$TMP_DIR/" "https://go.dev/dl/go${version}.linux-$ARCH.tar.gz"
|
return 0
|
||||||
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf "$TMP_DIR/go${version}.linux-$ARCH.tar.gz"
|
fi
|
||||||
fi
|
|
||||||
|
if [[ "$UNAME_STR" == "Darwin" ]]; then
|
||||||
|
wget -P "$TMP_DIR/" "https://go.dev/dl/go${version}.darwin-$ARCH.pkg"
|
||||||
|
sudo installer -target / -pkg "$TMP_DIR/go${version}.darwin-$ARCH.pkg"
|
||||||
|
elif [[ "$UNAME_STR" == "Linux" ]]; then
|
||||||
|
wget -P "$TMP_DIR/" "https://go.dev/dl/go${version}.linux-$ARCH.tar.gz"
|
||||||
|
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf "$TMP_DIR/go${version}.linux-$ARCH.tar.gz"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_go
|
||||||
|
Loading…
Reference in New Issue
Block a user