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 2 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
9 changes: 9 additions & 0 deletions utils/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ fi
# don't have a name e.g. https://example.com/.
if [ -n "$DOWNLOAD_BACKEND" ]; then
download_backend="$DOWNLOAD_BACKEND"
elif command -v wget >& /dev/null && wget --version|grep 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 @@ -46,6 +49,12 @@ progress_text="Downloading '${out_file##*/}'"
log_info "downloading '$url' to '$out_file'"

case "$download_backend" in
"wget2")
wget "$url" --progress=dot --no-verbose -O "$out_file" 2>&1 \
| grep --line-buffered --color=never -oE '[0-9]+%' \
| zenity --progress --auto-kill --auto-close --text="$progress_text"
;;

"wget")
wget "$url" --progress=dot --no-verbose --show-progress -O "$out_file" 2>&1 \
| grep --line-buffered --color=never -oE '[0-9]+%' \
Expand Down
Loading