From: Frank Brehm Date: Tue, 7 Sep 2021 05:38:27 +0000 (+0200) Subject: Updating necessary python versions in bin/update-env.sh X-Git-Tag: 1.5.2^2~11 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=754743df6baef1042a001b3c6dcf5165de8b5980;p=pixelpark%2Fcreate-terraform.git Updating necessary python versions in bin/update-env.sh --- diff --git a/bin/update-env.sh b/bin/update-env.sh index 049ece8..99c7d0f 100755 --- a/bin/update-env.sh +++ b/bin/update-env.sh @@ -7,7 +7,7 @@ VERBOSE="n" DEBUG="n" QUIET='n' -VERSION="2.2" +VERSION="2.3" # console colors: RED="" @@ -22,6 +22,8 @@ BASE_DIR=$( dirname "$( dirname "$0" )" ) cd "${BASE_DIR}" BASE_DIR=$( readlink -f . ) +declare -a VALID_PY_VERSIONS=("3.9" "3.8" "3.7" "3.6") + PIP_OPTIONS= export VIRTUAL_ENV_DISABLE_PROMPT=y @@ -268,7 +270,6 @@ get_options() { #------------------------------------------------------------------------------ init_venv() { - local -a valid_py_versions=("3.8" "3.7" "3.6" "3.5") local py_version= local python= local found="n" @@ -281,7 +282,7 @@ init_venv() { if [[ ! -f venv/bin/activate ]] ; then found="n" - for py_version in "${valid_py_versions[@]}" ; do + for py_version in "${VALID_PY_VERSIONS[@]}" ; do python="python${py_version}" debug "Testing Python binary '${CYAN}${python}${NORMAL}' …" if type -t "${python}" >/dev/null ; then @@ -296,7 +297,7 @@ init_venv() { if [[ "${found}" == "n" ]] ; then empty_line >&2 error "Did not found a usable Python version." >&2 - error "Usable Python versions are: ${YELLOW}${valid_py_versions[*]}${NORMAL}." >&2 + error "Usable Python versions are: ${YELLOW}${VALID_PY_VERSIONS[*]}${NORMAL}." >&2 empty_line >&2 exit 5 fi