From 6fad37b8442fa08d5a296848461e1d46511d1fb5 Mon Sep 17 00:00:00 2001 From: MengMengCode <227010654+MengMengCode@users.noreply.github.com> Date: Mon, 8 Jun 2026 15:55:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=89=E8=A3=85=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=B8=8B=E8=BD=BD=E5=A4=B1=E8=B4=A5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 87804a6..3a852dc 100644 --- a/install.sh +++ b/install.sh @@ -54,7 +54,7 @@ run_step() { step_name="$1" shift log "开始:$step_name" - if "$@" >> "$LOG_FILE" 2>&1; then + if ( "$@" ) >> "$LOG_FILE" 2>&1; then log "完成:$step_name" return 0 fi @@ -846,15 +846,18 @@ download_release_if_needed() { trap 'rm -rf "$tmp_dir"' 0 if has_cmd curl; then - curl -fL "$download_url" -o "$tmp_dir/$ASSET" + curl -fL --retry 6 --retry-delay 2 --connect-timeout 20 --max-time 600 "$download_url" -o "$tmp_dir/$ASSET" || + die "Release package download failed: $download_url" elif has_cmd wget; then - wget -O "$tmp_dir/$ASSET" "$download_url" + wget --tries=6 --timeout=30 --waitretry=2 -O "$tmp_dir/$ASSET" "$download_url" || + die "Release package download failed: $download_url" else die "下载发行版包需要 curl 或 wget。" fi - tar -xzf "$tmp_dir/$ASSET" -C "$tmp_dir" - cd "$tmp_dir/clicd-linux-amd64" + [ -s "$tmp_dir/$ASSET" ] || die "Release package is empty: $download_url" + tar -xzf "$tmp_dir/$ASSET" -C "$tmp_dir" || die "Failed to extract release package: $tmp_dir/$ASSET" + cd "$tmp_dir/clicd-linux-amd64" || die "Release package layout is invalid: missing clicd-linux-amd64 directory" [ -f "./clicd" ] || die "下载的发行版包中未找到 clicd 二进制。" }