From 618d8bce68559d6e083f5e2e404ffdce126f2d54 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 30 Aug 2026 14:28:48 +0000 Subject: [PATCH] feat: show component download progress --- install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index ecd0b60..b570e6c 100644 --- a/install.sh +++ b/install.sh @@ -96,7 +96,7 @@ COMPOSE_TEMPLATE=$(template_file compose.yaml) DOCKERFILE_TEMPLATE=$(template_file Dockerfile.bootstrap) umask 077 printf 'XYMEDIA_INSTALL_DIR=%s\nXYMEDIA_POSTGRES_HOST=%s\nXYMEDIA_POSTGRES_PORT=%s\nXYMEDIA_POSTGRES_DATABASE=%s\nXYMEDIA_POSTGRES_USER=%s\nXYMEDIA_API_PORT=%s\nXYMEDIA_WEBDAV_PORT=%s\nXYMEDIA_TVBOX_PORT=%s\n' "$INSTALL_DIR" "$PG_HOST" "$PG_PORT" "$PG_DB" "$PG_USER" "$API_PORT" "$WEBDAV_PORT" "$TVBOX_PORT" >"$INSTALL_DIR/.env" -progress '下载公开版本目录' +progress '下载公开版本目录(读取 App、TMM、Title 当前版本)' curl --fail --silent --show-error --location --proto '=https' --tlsv1.2 "$CATALOG_URL" -o "$INSTALL_DIR/catalog-v1.json" python3 - "$INSTALL_DIR/catalog-v1.json" <<'PY' || die 'invalid public catalog' import json, sys @@ -123,7 +123,9 @@ download_extract() { local url=$3 local target=$4 local archive="$INSTALL_DIR/state/$component-$version.archive" - curl --fail --silent --show-error --location --proto '=https' --tlsv1.2 "$url" -o "$archive" + printf ' 正在下载 %s %s(%s)\n' "$component" "$version" "${url##*/}" + curl --fail --show-error --location --proto '=https' --tlsv1.2 --progress-bar "$url" -o "$archive" + printf ' 正在解压 %s %s\n' "$component" "$version" local tarball="$archive.tar" if [[ $url == *.tar.gz || $url == *.tgz ]]; then gzip -dc "$archive" >"$tarball"; else zstd -dc "$archive" >"$tarball"; fi python3 - "$tarball" "$target" <<'PY'