From c32af0c6533498e9488a2d94389ff2bf1a8b8338 Mon Sep 17 00:00:00 2001 From: Zadkiel AHARONIAN Date: Tue, 9 Jul 2024 17:19:03 +0200 Subject: [PATCH] Update helm-git-plugin.sh --- helm-git-plugin.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/helm-git-plugin.sh b/helm-git-plugin.sh index 0ef767ca..e400ea32 100755 --- a/helm-git-plugin.sh +++ b/helm-git-plugin.sh @@ -4,18 +4,22 @@ set -eu -readonly bin_name="helm-git" -readonly allowed_protocols="https http file ssh" -readonly url_prefix="git+" - -readonly error_invalid_prefix="Git url should start with '$url_prefix'. Please check helm-git usage." -readonly error_invalid_protocol="Protocol not allowed, it should match one of theses: $allowed_protocols." - +bin_name="helm-git" +readonly bin_name +allowed_protocols="https http file ssh" +readonly allowed_protocols +url_prefix="git+" +readonly url_prefix +error_invalid_prefix="Git url should start with '$url_prefix'. Please check helm-git usage." +readonly error_invalid_prefix +error_invalid_protocol="Protocol not allowed, it should match one of theses: $allowed_protocols." +readonly error_invalid_protocol + +# Debug & trace output configuration debug=0 if [ "${HELM_GIT_DEBUG:-}" = "1" ]; then debug=1 fi - trace=0 git_output="/dev/null" git_quiet="--quiet" @@ -25,7 +29,12 @@ if [ "${HELM_GIT_TRACE:-}" = "1" ]; then git_output="/dev/stderr" git_quiet="" fi +readonly trace +readonly debug +readonly git_output +readonly git_quiet +# Set default value for TMPDIR export TMPDIR="${TMPDIR:-/tmp}" # Cache repos or charts depending on the cache path existing in the environment variables