We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8d30a6f + 74f0ca3 commit 5092891Copy full SHA for 5092891
bin/cocos
@@ -3,5 +3,24 @@
3
COCOS_CONSOLE_BIN_DIRECTORY=$(dirname "$0")
4
COCOS_CONSOLE_BIN_DIRECTORY=$(cd "$COCOS_CONSOLE_BIN_DIRECTORY" && pwd -P)
5
6
-python "$COCOS_CONSOLE_BIN_DIRECTORY/cocos.py" "$@"
+
7
+if hash python2 2>/dev/null; then
8
+ PYTHON=python2
9
+else
10
+ if hash python 2>/dev/null; then
11
+ VERSION="python --version"
12
+ if $VERSION 2>&1 >/dev/null | grep "Python 2" ; then
13
+ PYTHON=python
14
+ else
15
+ echo "require Python 2,but $($VERSION) found"
16
+ exit 1;
17
+ fi
18
19
+ echo "Python 2 required."
20
+ exit 1
21
22
+fi
23
24
25
+$PYTHON "$COCOS_CONSOLE_BIN_DIRECTORY/cocos.py" "$@"
26
0 commit comments