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

fixes #11578

Signed-off-by: Justin Wood <jwood@starry.com>
pull/11651/head
Justin Wood 2 years ago
parent 3636f68247
commit 0d9eb1341b
No known key found for this signature in database
GPG Key ID: 3FF31BAF104BF9E2

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

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

Loading…
Cancel
Save