summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-09-01 09:15:22 -0700
committerGitHub <noreply@github.com>2016-09-01 09:15:22 -0700
commita37ec7adfbf0832c08839751f1ce7bbe5de4de05 (patch)
tree52b167c5f57587cb84fbb6c9c2d05b554b4fe0aa /build.sh
parent5952512f68e10241ab1cc31d55dc91f42cf37ac2 (diff)
downloadcoreclr-a37ec7adfbf0832c08839751f1ce7bbe5de4de05.tar.gz
coreclr-a37ec7adfbf0832c08839751f1ce7bbe5de4de05.tar.bz2
coreclr-a37ec7adfbf0832c08839751f1ce7bbe5de4de05.zip
Revert "Avoid using 'which' for verifying prereqs"
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/build.sh b/build.sh
index 6ede273dd9..5959abdfa9 100755
--- a/build.sh
+++ b/build.sh
@@ -1,12 +1,15 @@
#!/usr/bin/env bash
# resolve python-version to use
-if [ "$PYTHON" == "" ]; then
- if hash python 2>/dev/null; then
+if [ "$PYTHON" == "" ] ; then
+ if which python >/dev/null 2>&1
+ then
PYTHON=python
- elif hash python2 2>/dev/null; then
+ elif which python2 >/dev/null 2>&1
+ then
PYTHON=python2
- elif hash python2.7 2>/dev/null; then
+ elif which python2.7 >/dev/null 2>&1
+ then
PYTHON=python2.7
else
echo "Unable to locate build-dependency python2.x!" 1>&2
@@ -16,7 +19,8 @@ fi
# validate python-dependency
# useful in case of explicitly set option.
-if ! hash $PYTHON 2>/dev/null; then
+if ! which $PYTHON > /dev/null 2>&1
+then
echo "Unable to locate build-dependency python2.x ($PYTHON)!" 1>&2
exit 1
fi
@@ -149,9 +153,9 @@ build_coreclr()
if [ $__UseNinja == 1 ]; then
generator="ninja"
buildFile="build.ninja"
- if hash ninja 2>/dev/null; then
+ if which ninja >/dev/null 2>&1; then
buildTool="ninja"
- elif hash ninja-build 2>/dev/null; then
+ elif which ninja-build >/dev/null 2>&1; then
buildTool="ninja-build"
else
echo "Unable to locate ninja!" 1>&2