From 38dfc7fb17af51c68d86fce8adf019d7f4ef873d Mon Sep 17 00:00:00 2001 From: tonyqui Date: Tue, 29 Nov 2022 17:52:01 +0100 Subject: [PATCH] When version does not start with a v, adds it automatically Signed-off-by: tonyqui --- scripts/get | 6 +++++- scripts/get-helm-3 | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/get b/scripts/get index fce6abd99..ab3786c7a 100755 --- a/scripts/get +++ b/scripts/get @@ -206,7 +206,11 @@ while [[ $# -gt 0 ]]; do '--version'|-v) shift if [[ $# -ne 0 ]]; then - export DESIRED_VERSION="${1}" + VERSION="${1}" + if [[ ! "$VERSION" =~ ^v ]]; then + VERSION="v${VERSION}" + fi + export DESIRED_VERSION=$VERSION else echo -e "Please provide the desired version. e.g. --version v2.4.0 or -v latest" exit 0 diff --git a/scripts/get-helm-3 b/scripts/get-helm-3 index 6177ba1a2..b271a2b53 100755 --- a/scripts/get-helm-3 +++ b/scripts/get-helm-3 @@ -298,7 +298,11 @@ while [[ $# -gt 0 ]]; do '--version'|-v) shift if [[ $# -ne 0 ]]; then - export DESIRED_VERSION="${1}" + VERSION="${1}" + if [[ ! "$VERSION" =~ ^v ]]; then + VERSION="v${VERSION}" + fi + export DESIRED_VERSION=$VERSION else echo -e "Please provide the desired version. e.g. --version v3.0.0 or -v canary" exit 0