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 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