fix unbound variable issue when get version

pull/2899/head
Hui Chen 7 years ago
parent 5ed2d6bddb
commit 895e8d086f

@ -192,8 +192,13 @@ set -u
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
'--version'|-v) '--version'|-v)
export DESIRED_VERSION="${2}"
shift shift
if [[ $# -ne 0 ]]; then
export DESIRED_VERSION="${1}"
else
echo -e "Please provide the desired version. e.g. --version v2.4.0 or -v latest"
exit 0
fi
;; ;;
'--help'|-h) '--help'|-h)
help help

Loading…
Cancel
Save