Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Add support for Wget2 #619

Merged
merged 7 commits into from
May 4, 2024
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions utils/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ progress_bar() {
# don't have a name e.g. https://example.com/.
if [ -n "$DOWNLOAD_BACKEND" ]; then
download_backend="$DOWNLOAD_BACKEND"
elif command -v wget2 >& /dev/null; then
log_info "using wget2 backend"
download_backend="wget2"
elif command -v wget >& /dev/null; then
log_info "using wget backend"
download_backend="wget"
Expand All @@ -51,6 +54,11 @@ progress_text="Downloading '${out_file##*/}'"
log_info "downloading '$url' to '$out_file'"

case "$download_backend" in
"wget2")
wget2 "$url" --no-verbose --force-progress -O "$out_file" 2>&1 \
| progress_bar "$progress_text"
;;

"wget")
wget "$url" --progress=dot --no-verbose --show-progress -O "$out_file" 2>&1 \
| progress_bar "$progress_text"
Expand Down
Loading