update script

This commit is contained in:
jay 2023-02-27 00:17:14 +08:00
parent f220a40935
commit 0e96acc8a9
1 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,10 @@ if [ ! -d "$HOME/apps" ]; then
fi fi
function install_golang { function install_golang {
if command -v go ; then
return 0
fi
local tmpDir=$(mktemp -d) local tmpDir=$(mktemp -d)
local url="https://go.dev/dl/go$GO_VERSION.$OSTYPE-$ARCH.tar.gz" local url="https://go.dev/dl/go$GO_VERSION.$OSTYPE-$ARCH.tar.gz"
@ -40,6 +44,9 @@ function install_golang {
} }
function install_nodejs { function install_nodejs {
if command -v node ; then
return 0
fi
local tmpDir=$(mktemp -d) local tmpDir=$(mktemp -d)
local arch="" local arch=""
@ -81,6 +88,9 @@ function install_nodejs {
} }
function install_rust { function install_rust {
if command -v cargo ; then
return 0
fi
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile default -y curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile default -y
} }