Merge pull request #11651 from Callek/better-get-version

Avoid confusing error when passing in '--version X.Y.Z' to get-helm
pull/12343/head
Joe Julian 1 year ago committed by GitHub
commit c4fbcb214a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -207,6 +207,10 @@ while [[ $# -gt 0 ]]; do
shift
if [[ $# -ne 0 ]]; then
export DESIRED_VERSION="${1}"
if [[ "$1" != "v"* ]]; then
echo "Expected version arg ('${DESIRED_VERSION}') to begin with 'v', fixing..."
export DESIRED_VERSION="v${1}"
fi
else
echo -e "Please provide the desired version. e.g. --version v2.4.0 or -v latest"
exit 0

@ -305,6 +305,10 @@ while [[ $# -gt 0 ]]; do
shift
if [[ $# -ne 0 ]]; then
export DESIRED_VERSION="${1}"
if [[ "$1" != "v"* ]]; then
echo "Expected version arg ('${DESIRED_VERSION}') to begin with 'v', fixing..."
export DESIRED_VERSION="v${1}"
fi
else
echo -e "Please provide the desired version. e.g. --version v3.0.0 or -v canary"
exit 0

Loading…
Cancel
Save