From 2935ca98bee20f41fa46355a2735a2db59510c79 Mon Sep 17 00:00:00 2001 From: Jack Francis Date: Wed, 6 Apr 2022 15:35:56 -0700 Subject: [PATCH] add --install-dir and --binary-name to get-helm script Signed-off-by: Jack Francis --- scripts/get | 20 ++++++++++++++++++++ scripts/get-helm-3 | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/scripts/get b/scripts/get index fce6abd99..78f1b235d 100755 --- a/scripts/get +++ b/scripts/get @@ -183,6 +183,8 @@ help () { echo -e "\t[--version|-v ]" echo -e "\te.g. --version v2.4.0 or -v latest" echo -e "\t[--no-sudo] ->> install without sudo" + echo -e "\t[--install-dir] ->> install helm binary to a specific directory, e.g., /usr/bin" + echo -e "\t[--binary-name] ->> name of helm binary, e.g., helm-v3.8.1" } # cleanup temporary files to avoid https://github.com/helm/helm/issues/2977 @@ -215,6 +217,24 @@ while [[ $# -gt 0 ]]; do '--no-sudo') USE_SUDO="false" ;; + '--install-dir') + shift + if [[ $# -ne 0 ]]; then + export HELM_INSTALL_DIR="${1}" + else + echo -e "Please provide the desired installation directory. e.g. --install-dir /usr/bin" + exit 0 + fi + ;; + '--binary-name') + shift + if [[ $# -ne 0 ]]; then + export BINARY_NAME="${1}" + else + echo -e "Please provide the desired binary name. e.g. --binary-name helm-v3.8.1" + exit 0 + fi + ;; '--help'|-h) help exit 0 diff --git a/scripts/get-helm-3 b/scripts/get-helm-3 index 9c6035864..9283e7f42 100755 --- a/scripts/get-helm-3 +++ b/scripts/get-helm-3 @@ -265,6 +265,8 @@ help () { echo -e "\t[--version|-v ] . When not defined it fetches the latest release from GitHub" echo -e "\te.g. --version v3.0.0 or -v canary" echo -e "\t[--no-sudo] ->> install without sudo" + echo -e "\t[--install-dir] ->> install helm binary to a specific directory, e.g., /usr/bin" + echo -e "\t[--binary-name] ->> name of helm binary, e.g., helm-v3.8.1" } # cleanup temporary files to avoid https://github.com/helm/helm/issues/2977 @@ -302,6 +304,24 @@ while [[ $# -gt 0 ]]; do '--no-sudo') USE_SUDO="false" ;; + '--install-dir') + shift + if [[ $# -ne 0 ]]; then + export HELM_INSTALL_DIR="${1}" + else + echo -e "Please provide the desired installation directory. e.g. --install-dir /usr/bin" + exit 0 + fi + ;; + '--binary-name') + shift + if [[ $# -ne 0 ]]; then + export BINARY_NAME="${1}" + else + echo -e "Please provide the desired binary name. e.g. --binary-name helm-v3.8.1" + exit 0 + fi + ;; '--help'|-h) help exit 0