buildtoolchain: try fetching using cURL if wget is not available

This commit is contained in:
Shiz 2024-01-03 13:33:18 +01:00
parent d057a0ce5e
commit 2122050b3e

View File

@ -64,7 +64,13 @@ download() {
if [ $DL -eq 1 ]; then
echo "Downloading $2..."
wget "$2" -c -O "$1" || die "Could not download $2"
if command -v wget >/dev/null 2>&1; then
wget "$2" -c -O "$1" || die "Could not download $2 using wget"
elif command -v curl >/dev/null 2>&1; then
curl -o "$1" -fL "$2" || die "Could not download $2 using cURL"
else
die "Could not download $2 (no wget or cURL)"
fi
fi
}