When version does not start with a v, adds it automatically

Signed-off-by: tonyqui <tonyqui@hotmail.com>
pull/11580/head
tonyqui 3 years ago
parent 21e694e0f9
commit 38dfc7fb17

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

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

Loading…
Cancel
Save