Compare commits
No commits in common. "62f68959c74b193bc6ab497262608f08240ed652" and "54bbdc180a22fdd6e43208debf422387ed7703c0" have entirely different histories.
62f68959c7
...
54bbdc180a
@ -196,17 +196,11 @@ ensure_usr_local_bin_persist() {
|
|||||||
|
|
||||||
download_with_progress() {
|
download_with_progress() {
|
||||||
# $1 url, $2 dest
|
# $1 url, $2 dest
|
||||||
local url="$1" out="$2" content_length
|
local url="$1" out="$2" cl
|
||||||
need_tool curl pv || return 1
|
need_tool curl pv || return 1
|
||||||
|
cl=$(curl -fsSLI "$url" 2>/dev/null | awk 'tolower($0) ~ /^content-length:/ {print $2}' | tr -d '\r')
|
||||||
content_length=$(
|
if [ -n "$cl" ]; then
|
||||||
curl -fsSLI "$url" 2>/dev/null |
|
curl -fsSL "$url" | pv -s "$cl" >"$out" || {
|
||||||
awk '(tolower($1) ~ /^content-length:/) && ($2 + 0 > 0) {print $2+0}' |
|
|
||||||
tail -1 | tr -cd '[:digit:]' || true
|
|
||||||
)
|
|
||||||
|
|
||||||
if [ -n "$content_length" ]; then
|
|
||||||
curl -fsSL "$url" | pv -s "$content_length" >"$out" || {
|
|
||||||
msg_error "Download failed: $url"
|
msg_error "Download failed: $url"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1692,11 +1692,7 @@ function download_with_progress() {
|
|||||||
|
|
||||||
# Content-Length aus HTTP-Header holen
|
# Content-Length aus HTTP-Header holen
|
||||||
local content_length
|
local content_length
|
||||||
content_length=$(
|
content_length=$(curl -fsSLI "$url" | awk '/Content-Length/ {print $2}' | tr -d '\r' || true)
|
||||||
curl -fsSLI "$url" 2>/dev/null |
|
|
||||||
awk '(tolower($1) ~ /^content-length:/) && ($2 + 0 > 0) {print $2+0}' |
|
|
||||||
tail -1 | tr -cd '[:digit:]' || true
|
|
||||||
)
|
|
||||||
|
|
||||||
if [[ -z "$content_length" ]]; then
|
if [[ -z "$content_length" ]]; then
|
||||||
if ! curl -fL# -o "$output" "$url"; then
|
if ! curl -fL# -o "$output" "$url"; then
|
||||||
@ -6209,3 +6205,4 @@ function fetch_and_deploy_archive() {
|
|||||||
msg_ok "Successfully deployed archive to $directory"
|
msg_ok "Successfully deployed archive to $directory"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user