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
This commit is contained in:
		
							
								
								
									
										40
									
								
								setup.sh
									
									
									
									
									
								
							
							
						
						
									
										40
									
								
								setup.sh
									
									
									
									
									
								
							| @@ -17,37 +17,17 @@ function check_installed_python() { | |||||||
|         exit 2 |         exit 2 | ||||||
|     fi |     fi | ||||||
|  |  | ||||||
|     which python3.9 |     for v in {9..7}; do | ||||||
|     if [ $? -eq 0 ]; then |         PYTHON="python3.${v}" | ||||||
|         echo "using Python 3.9" |         which $PYTHON | ||||||
|         PYTHON=python3.9 |         if [ $? -eq 0 ]; then | ||||||
|         check_installed_pip |             check_installed_pip | ||||||
|         return |             return | ||||||
|     fi |         fi | ||||||
|  |     done  | ||||||
|  |  | ||||||
|  |     echo "No usable python found. Please make sure to have python3.7 or newer installed" | ||||||
|     which python3.8 |     exit 1 | ||||||
|     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 |  | ||||||
| } | } | ||||||
|  |  | ||||||
| function updateenv() { | function updateenv() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user