abort if neither curl nor wget are available

Additionally, hide the output of those checks.

fixes #537
This commit is contained in:
claustromaniac 2018-11-18 17:54:05 -03:00
parent c12eb0fdc6
commit c878512a07
No known key found for this signature in database
GPG key ID: 6FFF2F5AB0F3AA2D

View file

@ -16,9 +16,14 @@ DOWNLOAD_TO_STDOUT="curl -s"
DOWNLOAD_TO_FILE="curl -O"
# Use wget if curl is not available.
if [[ -z $(command -v "curl") ]]; then
DOWNLOAD_TO_STDOUT="wget --quiet --output-document=-"
DOWNLOAD_TO_FILE="wget"
if [[ -z $(command -v "curl") ]] > /dev/null 2>&1; then
if [[ $(command -v "wget") ]] > /dev/null 2>&1; then
DOWNLOAD_TO_STDOUT="wget --quiet --output-document=-"
DOWNLOAD_TO_FILE="wget"
else
echo -e "This script requires either curl or wget to be installed.\nProcess aborted"
exit 0
fi
fi
## get the full path of this script (readlink for Linux, greadlink for Mac with coreutils installed)