Skip to content

Commit f5041ca

Browse files
committed
Fix install.sh script so it will find "python3" if that's the only
thing around.
1 parent e1267f1 commit f5041ca

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

install.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
set -e
22

3+
find_python() {
4+
set +e
5+
unset BEST_VERSION
6+
for V in 37 3.7 38 3.8 3
7+
do
8+
which -s python$V
9+
if [ x$? == x0 ]
10+
then
11+
if [ x$BEST_VERSION == x ]
12+
then
13+
BEST_VERSION=$V
14+
fi
15+
fi
16+
done
17+
echo $BEST_VERSION
18+
set -e
19+
}
20+
21+
if [ x$INSTALL_PYTHON_VERSION == x ]; then
22+
INSTALL_PYTHON_VERSION=`find_python`
23+
fi
24+
25+
326
if [ `uname` = "Linux" ] && type apt-get; then
427
# Debian/Ubuntu
528
sudo apt-get install -y npm python3-dev

0 commit comments

Comments
 (0)