Skip to content

Commit 70a9c7f

Browse files
committed
RF: set return code for python/pip commands
1 parent d7ed27b commit 70a9c7f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test_tools.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
# Return code
2+
RET=0
3+
14
echo "Python on path: `which python`"
25
echo "Python cmd: $PYTHON_CMD"
36
$PYTHON_CMD --version
7+
if [ $? -ne 0 ] ; then RET=1; fi
48

59
echo "pip on path: `which pip`"
610
echo "pip cmd: $PIP_CMD"
711
$PIP_CMD --version
12+
if [ $? -ne 0 ] ; then RET=1; fi
813

914
echo "virtualenv on path: `which virtualenv`"
1015
echo "virtualenv cmd: $VIRTUALENV_CMD"
1116

12-
# Return code
13-
RET=0
1417

1518
python_version=`$PYTHON_CMD -c \
1619
'import sys; print("{}.{}.{}".format(*sys.version_info[:3]))'`
@@ -90,5 +93,5 @@ else # not virtualenv
9093
;;
9194
esac
9295
fi
93-
# Set the return code
96+
# Set the final return code
9497
(exit $RET)

0 commit comments

Comments
 (0)