From c0270140197f459979ff21a618729afb844a854a Mon Sep 17 00:00:00 2001 From: Wonyeong Choi Date: Wed, 2 Nov 2022 21:53:22 +0900 Subject: [PATCH 1/2] Add a flag var to check git is installed or not Signed-off-by: Wonyeong Choi --- scripts/get-helm-3 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/get-helm-3 b/scripts/get-helm-3 index 9c603586420..96ed0a40899 100755 --- a/scripts/get-helm-3 +++ b/scripts/get-helm-3 @@ -29,6 +29,7 @@ HAS_CURL="$(type "curl" &> /dev/null && echo true || echo false)" HAS_WGET="$(type "wget" &> /dev/null && echo true || echo false)" HAS_OPENSSL="$(type "openssl" &> /dev/null && echo true || echo false)" HAS_GPG="$(type "gpg" &> /dev/null && echo true || echo false)" +HAS_GIT="$(type "git" &> /dev/null && echo true || echo false)" # initArch discovers the architecture for this system. initArch() { @@ -97,6 +98,11 @@ verifySupported() { exit 1 fi fi + + if [ "${HAS_GIT}" != "true" ]; then + echo "Git is required for plugin install" + exit 1 + fi } # checkDesiredVersion checks if the desired version is available. From 0ebd6202d8fb1fb334a7670896d6a97cc736688c Mon Sep 17 00:00:00 2001 From: Wonyeong Choi Date: Sun, 6 Nov 2022 11:31:00 +0900 Subject: [PATCH 2/2] Update logic of non-git situation just to print warning logs Signed-off-by: Wonyeong Choi --- scripts/get-helm-3 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/get-helm-3 b/scripts/get-helm-3 index 96ed0a40899..6177ba1a254 100755 --- a/scripts/get-helm-3 +++ b/scripts/get-helm-3 @@ -100,8 +100,7 @@ verifySupported() { fi if [ "${HAS_GIT}" != "true" ]; then - echo "Git is required for plugin install" - exit 1 + echo "[WARNING] Could not find git. It is required for plugin installation." fi }