aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/makefile/download_dependencies.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/makefile/download_dependencies.sh')
-rwxr-xr-xtensorflow/contrib/makefile/download_dependencies.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/tensorflow/contrib/makefile/download_dependencies.sh b/tensorflow/contrib/makefile/download_dependencies.sh
index 0a47f50c43..4ae18b2cef 100755
--- a/tensorflow/contrib/makefile/download_dependencies.sh
+++ b/tensorflow/contrib/makefile/download_dependencies.sh
@@ -63,12 +63,17 @@ download_and_extract() {
elif [[ "${url}" == *zip ]]; then
tempdir=$(mktemp -d)
tempdir2=$(mktemp -d)
- wget -P ${tempdir} ${url}
- unzip ${tempdir}/* -d ${tempdir2}
+ if [[ "$OSTYPE" == "darwin"* ]]; then
+ # macOS (AKA darwin) doesn't have wget.
+ (cd "${tempdir}"; curl --remote-name --silent --location "${url}")
+ else
+ wget -P "${tempdir}" "${url}"
+ fi
+ unzip "${tempdir}"/* -d "${tempdir2}"
# unzip has no strip components, so unzip to a temp dir, and move the files
# we want from the tempdir to destination.
- cp -R ${tempdir2}/*/* ${dir}/
- rm -rf ${tempdir2} ${tempdir}
+ cp -R "${tempdir2}"/*/* "${dir}"/
+ rm -rf "${tempdir2}" "${tempdir}"
fi
# Delete any potential BUILD files, which would interfere with Bazel builds.