From e932f3b2e7519b7db5ae710e92347b4771e40930 Mon Sep 17 00:00:00 2001 From: smotherh Date: Wed, 2 May 2018 11:49:45 -0700 Subject: [PATCH] Added Python checks --- install.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 9d834eeec..ccdf5e9c0 100755 --- a/install.sh +++ b/install.sh @@ -4,11 +4,24 @@ git submodule init git submodule update cd search/pybinds/ +if hash python 2>/dev/null; then + if python -c 'import sys; print(sys.version_info[0])' | grep -q 3; then + echo "Python version 3 confirmed" + else + echo "Python detected, but it must be version 3.x"; + exit 1; + fi +else + echo "Python not found" + exit 1; +fi + + # Check for cmake version 3 under "cmake" and "cmake3" -if hash cmake 2>/dev/null; then - cmake ./ -elif hash cmake3 2>/dev/null; then +if hash cmake3 2>/dev/null; then cmake3 ./ +elif hash cmake 2>/dev/null; then + cmake ./ else echo >&2 "Cannot find cmake. Aborting..." exit 1