Adding wget support to fetch scripts

This commit is contained in:
fusion809
2018-07-15 17:43:21 +10:00
committed by Paul Chote
parent 81e1b39bb9
commit e1b1070bcf
4 changed files with 41 additions and 11 deletions

10
thirdparty/noget.sh vendored
View File

@@ -6,8 +6,14 @@
# Copy-paste the entire script into http://shellcheck.net to check.
####
command -v curl >/dev/null 2>&1 || command -v wget > /dev/null 2>&1 || { echo >&2 "Obtaining thirdparty dependencies requires curl or wget."; exit 1; }
archive="$1"
version="$2"
curl -o "$archive.zip" -Ls https://nuget.org/api/v2/package/"$archive"/"$version"
if command -v curl >/dev/null 2>&1; then
curl -o "$archive.zip" -Ls https://nuget.org/api/v2/package/"$archive"/"$version"
else
wget -cq https://nuget.org/api/v2/package/"$archive"/"$version" -O "$archive.zip"
fi
mkdir -p "$archive"
unzip -o -qq "$archive.zip" -d "$archive" && rm "$archive.zip"
unzip -o -qq "$archive.zip" -d "$archive" && rm "$archive.zip"