diff options
author | Jostein Kjønigsen <jostein@kjonigsen.net> | 2016-07-07 10:49:20 +0200 |
---|---|---|
committer | Jostein Kjønigsen <jostein@kjonigsen.net> | 2016-07-08 09:34:31 +0200 |
commit | 38c683c17a19bb7119d7334061f18257d9d6ccbb (patch) | |
tree | b38dfcb99c52b5321f7ab9bf8423f39a17460f39 /build.sh | |
parent | de7eaa720b309f3cea66e2e276392a60e363c2cc (diff) | |
download | coreclr-38c683c17a19bb7119d7334061f18257d9d6ccbb.tar.gz coreclr-38c683c17a19bb7119d7334061f18257d9d6ccbb.tar.bz2 coreclr-38c683c17a19bb7119d7334061f18257d9d6ccbb.zip |
Resolve Python2.7 when executable is not called 'python'.
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -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() { |