@@ -10,32 +10,32 @@ PYTHON_MINIMUM_MINOR=4
1010PYTHON3_REF=$( which python3 | grep " /python3" )
1111PYTHON_REF=$( which python | grep " /python" )
1212
13- error_msg (){
14- echo " NoPython"
13+ error_msg () {
14+ echo " NoPython"
1515}
1616
17- python_ref (){
18- local my_ref=$1
19- echo $( $my_ref -c ' import platform; major, minor, patch = platform.python_version_tuple(); print(major); print(minor);' )
17+ python_ref () {
18+ local my_ref=$1
19+ echo $( $my_ref -c ' import platform; major, minor, patch = platform.python_version_tuple(); print(major); print(minor);' )
2020}
2121
2222# Print success_msg/error_msg according to the provided minimum required versions
23- check_version (){
24- local major=$1
25- local minor=$2
26- local python_ref=$3
27- [[ $major -ge $PYTHON_MINIMUM_MAJOR && $minor -ge $PYTHON_MINIMUM_MINOR ]] && echo $python_ref || error_msg
23+ check_version () {
24+ local major=$1
25+ local minor=$2
26+ local python_ref=$3
27+ [[ $major -ge $PYTHON_MINIMUM_MAJOR && $minor -ge $PYTHON_MINIMUM_MINOR ]] && echo $python_ref || error_msg
2828}
2929
3030# Logic
3131if [[ ! -z $PYTHON3_REF ]]; then
32- version=($( python_ref python3) )
33- check_version ${version[0]} ${version[1]} $PYTHON3_REF
32+ version=($( python_ref python3) )
33+ check_version ${version[0]} ${version[1]} $PYTHON3_REF
3434elif [[ ! -z $PYTHON_REF ]]; then
35- # Didn't find python3, let's try python
36- version=($( python_ref python) )
37- check_version ${version[0]} ${version[1]} $PYTHON_REF
35+ # Didn't find python3, let's try python
36+ version=($( python_ref python) )
37+ check_version ${version[0]} ${version[1]} $PYTHON_REF
3838else
39- # Python is not installed at all
40- error_msg
39+ # Python is not installed at all
40+ error_msg
4141fi
0 commit comments