Skip to content

Commit ad44f6e

Browse files
committed
simplify version check
1 parent 0d44cb2 commit ad44f6e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

install.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ function install_software() {
6161
}
6262

6363
function check_python_version() {
64-
python3 -V | grep '3.[7-9].[0-9]' &> /dev/null
65-
if ! [ $? == 0 ]; then
64+
if ! python3 -V | grep '3.[7-9].[0-9]' > /dev/null 2>&1; then
6665
echo "An unsupported version of python 3 is installed. Must have python 3.7+ installed to use the Hologram SDK"
6766
exit 1
6867
fi
@@ -125,8 +124,7 @@ do
125124
pause "Installing $program. Press [Enter] key to continue...";
126125
install_software 'python3-pip'
127126
fi
128-
pip3 -V | grep '3.[7-9]' &> /dev/null
129-
if ! [ $? == 0 ]; then
127+
if ! pip3 -V | grep '3.[7-9]' >/dev/null 2>&1; then
130128
echo "pip3 is installed for an unsupported version of python."
131129
exit 1
132130
fi

0 commit comments

Comments
 (0)