File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 10
10
exit 1
11
11
fi
12
12
13
- # Get the version number of Python installed on the system .
13
+ # Get the version string .
14
14
python_version=$( $python_cmd --version 2>&1 | awk ' {print $2}' )
15
15
16
- # Extract the major version number (i.e. 3 from 3.x).
16
+ # Extract the major and minor version numbers (i.e. 3 and 6 from 3.6.x)
17
17
major_version=$( echo $python_version | cut -d. -f1)
18
+ minor_version=$( echo $python_version | cut -d. -f2)
18
19
19
- if [ " $major_version " == " 3" ]; then
20
- echo " Python 3 is installed."
20
+ # Check if the major version number is 3 and the minor version number is 6 or greater
21
+ if [ " $major_version " == " 3" ] && [ " $minor_version " -ge " 6" ]; then
22
+ echo " Python >= 3.6 is installed."
21
23
else
22
- echo " Python 3 is not installed."
24
+ echo " Python >= 3.6 is not installed."
23
25
exit 1
24
26
fi
25
27
You can’t perform that action at this time.
0 commit comments