Avoid confusing error when passing in '--version X.Y.Z'

fixes #11578

Signed-off-by: Justin Wood <jwood@starry.com>
This commit is contained in:
Justin Wood
2022-12-16 15:42:35 -05:00
parent 3636f68247
commit 0d9eb1341b
2 changed files with 8 additions and 0 deletions

View File

@@ -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

View File

@@ -299,6 +299,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