From 74d7497a47b3fe9ddc40895a3b3eb8b54d97f153 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Wed, 14 Jul 2021 19:25:51 -0600 Subject: [PATCH] Setup script tries to install python3.9 instead of 3.8 with this fix, python versions are also checked for in a loop instead of copy and pasted code --- setup.sh | 40 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/setup.sh b/setup.sh index ee3fee0a3..1393b012a 100755 --- a/setup.sh +++ b/setup.sh @@ -17,37 +17,17 @@ function check_installed_python() { exit 2 fi - which python3.9 - if [ $? -eq 0 ]; then - echo "using Python 3.9" - PYTHON=python3.9 - check_installed_pip - return - fi + for v in {9..7}; do + PYTHON="python3.${v}" + which $PYTHON + if [ $? -eq 0 ]; then + check_installed_pip + return + fi + done - - which python3.8 - if [ $? -eq 0 ]; then - echo "using Python 3.8" - PYTHON=python3.8 - check_installed_pip - return - fi - - - which python3.7 - if [ $? -eq 0 ]; then - echo "using Python 3.7" - PYTHON=python3.7 - check_installed_pip - return - fi - - - if [ -z ${PYTHON} ]; then - echo "No usable python found. Please make sure to have python3.7 or newer installed" - exit 1 - fi + echo "No usable python found. Please make sure to have python3.7 or newer installed" + exit 1 } function updateenv() {