Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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