From cd96d96c6f43f971c688620f7f8dee2d262c81a5 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Wed, 20 Sep 2017 11:01:28 -0400 Subject: Conditionally use wget or curl in download_wrapper --- libs/common | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libs/common b/libs/common index 8dff9d18..db72a974 100755 --- a/libs/common +++ b/libs/common @@ -91,7 +91,21 @@ download_wrapper() { '--' ) - wget "${wget_options[@]}" "${uris[@]}" + if hash wget > /dev/null 2>&1; then + + wget "${wget_options[@]}" "${uris[@]}" + + elif hash curl > /dev/null 2>&1; then + ( + cd "$download_dir" + + curl "${curl_options[@]}" "${uris[@]}" + ) + else + printf '\n%s\n\n' 'Error: Neither wget nor curl were found' 1>&2 + + return 1 + fi } diff_patch_file() { -- cgit v1.2.3-70-g09d2