From 0e96acc8a95ee4ba568d4078fac075764e6a2d25 Mon Sep 17 00:00:00 2001 From: jay Date: Mon, 27 Feb 2023 00:17:14 +0800 Subject: [PATCH] update script --- .chezmoiscripts/run_before_20_install_dev_lang.sh.tmpl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.chezmoiscripts/run_before_20_install_dev_lang.sh.tmpl b/.chezmoiscripts/run_before_20_install_dev_lang.sh.tmpl index 379a251..57bc3bd 100644 --- a/.chezmoiscripts/run_before_20_install_dev_lang.sh.tmpl +++ b/.chezmoiscripts/run_before_20_install_dev_lang.sh.tmpl @@ -16,6 +16,10 @@ if [ ! -d "$HOME/apps" ]; then fi function install_golang { + if command -v go ; then + return 0 + fi + local tmpDir=$(mktemp -d) local url="https://go.dev/dl/go$GO_VERSION.$OSTYPE-$ARCH.tar.gz" @@ -40,6 +44,9 @@ function install_golang { } function install_nodejs { + if command -v node ; then + return 0 + fi local tmpDir=$(mktemp -d) local arch="" @@ -81,6 +88,9 @@ function install_nodejs { } 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 }