Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Resolve Python2.7 when executable is not called 'python'.
Browse files Browse the repository at this point in the history
  • Loading branch information
josteink committed Jul 8, 2016
1 parent de7eaa7 commit 38c683c
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion build.sh
@@ -1,6 +1,29 @@
#!/usr/bin/env bash

PYTHON=${PYTHON:-python}
# resolve python-version to use
if [ "$PYTHON" == "" ] ; then
if which python >/dev/null 2>&1
then
PYTHON=python
elif which python2 >/dev/null 2>&1
then
PYTHON=python2
elif which python2.7 >/dev/null 2>&1
then
PYTHON=python2.7
else
echo "Unable to locate build-dependency python2.x!" 1>&2
exit 1
fi
fi

# validate python-dependency
# useful in case of explicitly set option.
if ! which $PYTHON > /dev/null 2>&1
then
echo "Unable to locate build-dependency python2.x ($PYTHON)!" 1>&2
exit 1
fi

usage()
{
Expand Down

0 comments on commit 38c683c

Please sign in to comment.