File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,11 @@ function checkMacPython2(){
40
40
else
41
41
python_version=" "
42
42
fi
43
+ check_python=` echo $python_version | grep " Python 2" `
44
+ echo $check_python
43
45
if [ " $python_version " == " " ] || [ " $python_root " == " /usr/bin/python" -a " $python_version " == " Python 2.7.10" ] ; then
44
46
python_version=" "
45
- else
47
+ elif [ -n " $check_python " ] ; then
46
48
while true
47
49
do
48
50
read -p " 找到:$python_version , 是否使用:(y/n),输入n来输入自定义使用的python路径,或者按ctrl + c退出: " use_python
@@ -60,6 +62,9 @@ function checkMacPython2(){
60
62
if [ " $use_python " == " y" ]; then
61
63
break
62
64
fi
65
+ else
66
+ echo " 您输入Python的不是Python2"
67
+ python_version=" "
63
68
fi
64
69
done
65
70
}
@@ -77,9 +82,10 @@ function checkMacPython3(){
77
82
else
78
83
python_version=" "
79
84
fi
85
+ check_python=` echo $python_version | grep " Python 3" `
80
86
if [ " $python_version " == " " ] || [ " $python_root " == " /usr/bin/python" -a " $python_version " == " Python 2.7.10" ] ; then
81
87
python_version=" "
82
- else
88
+ elif [ -n " $check_python " ] ; then
83
89
while true
84
90
do
85
91
read -p " 找到:$python_version , 是否使用:(y/n),输入n来输入自定义使用的python路径,或者按ctrl + c退出: " use_python
@@ -97,6 +103,9 @@ function checkMacPython3(){
97
103
if [ " $use_python " == " y" ]; then
98
104
break
99
105
fi
106
+ else
107
+ echo " 您输入Python的不是Python2"
108
+ python_version=" "
100
109
fi
101
110
done
102
111
}
You can’t perform that action at this time.
0 commit comments