summaryrefslogtreecommitdiff
path: root/init-tools.sh
diff options
context:
space:
mode:
authorAditya Mandaleeka <adityamandaleeka@users.noreply.github.com>2016-08-31 12:01:28 -0700
committerGitHub <noreply@github.com>2016-08-31 12:01:28 -0700
commitb73fad38425cd52008d830f7207f81873415e1a5 (patch)
tree7022ae8e362822ca9abc5d1d1524420f8c91f506 /init-tools.sh
parentfd5a96d96fdcc4a1a439b211d15ceca3a110a1eb (diff)
downloadcoreclr-b73fad38425cd52008d830f7207f81873415e1a5.tar.gz
coreclr-b73fad38425cd52008d830f7207f81873415e1a5.tar.bz2
coreclr-b73fad38425cd52008d830f7207f81873415e1a5.zip
Avoid using 'which' for verifying prereqs (#6994)
* Use hash instead of which in build.sh * Use hash instead of which in init-tools.sh. * Use hash instead of which in gen-buildsys-clang.sh.
Diffstat (limited to 'init-tools.sh')
-rwxr-xr-xinit-tools.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/init-tools.sh b/init-tools.sh
index e6966cc2f0..5b3b70288b 100755
--- a/init-tools.sh
+++ b/init-tools.sh
@@ -85,15 +85,15 @@ if [ ! -e $__PROJECT_JSON_FILE ]; then
if [ ! -e $__DOTNET_PATH ]; then
# curl has HTTPS CA trust-issues less often than wget, so lets try that first.
- which curl > /dev/null 2> /dev/null
- if [ $? -ne 0 ]; then
- mkdir -p "$__DOTNET_PATH"
- wget -q -O $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL
- echo "wget -q -O $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL"
+ if hash curl 2>/dev/null; then
+ curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL
+ echo "curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL"
else
- curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL
- echo "curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL"
+ mkdir -p "$__DOTNET_PATH"
+ wget -q -O $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL
+ echo "wget -q -O $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL"
fi
+
cd $__DOTNET_PATH
tar -xf $__DOTNET_PATH/dotnet.tar
if [ -n "$BUILDTOOLS_OVERRIDE_RUNTIME" ]; then