Status quo
Currently, curl is expected to be installed to be able to download an external script.
Expected
Consider checking if curl is not install, so we can use wget as fallback.
Example
Example used on bashunit:
# dependencies.sh : https://github.com/TypedDevs/bashunit/blob/main/src/dependencies.sh
function dependencies::has_curl() {
command -v curl >/dev/null 2>&1
}
function dependencies::has_wget() {
command -v wget >/dev/null 2>&1
}
# io.sh : https://github.com/TypedDevs/bashunit/blob/main/src/io.sh
function io::download_to() {
local url="$1"
local output="$2"
if dependencies::has_curl; then
curl -L -J -o "$output" "$url" 2>/dev/null
elif dependencies::has_wget; then
wget -q -O "$output" "$url" 2>/dev/null
else
return 1
fi
}
Status quo
Currently, curl is expected to be installed to be able to download an external script.
Expected
Consider checking if curl is not install, so we can use wget as fallback.
Example
Example used on bashunit: