fix(install): add curl error check, replace destructive pull fallback with skip
This commit is contained in:
11
install.zsh
11
install.zsh
@@ -112,8 +112,9 @@ function at-repos-pull() {
|
||||
git clean -fd 2>/dev/null
|
||||
git stash -u
|
||||
if ! git pull;then
|
||||
rm -rf $d/repos/${repo##*/}
|
||||
at-repos-clone
|
||||
echo "❌ pull failed: ${repo##*/} — skipping (manual fix needed)"
|
||||
cd $d/repos
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
rv=$(echo "$repos_v" | jq -r ".[\"${repo##*/}\"]")
|
||||
@@ -245,7 +246,11 @@ function patch-apply-with-curl() {
|
||||
local download_url=$4
|
||||
local download_target=$5
|
||||
|
||||
curl -sL "${download_url}" -o "$d/repos/${target}/${download_target}"
|
||||
if ! curl -sfL "${download_url}" -o "$d/repos/${target}/${download_target}"; then
|
||||
echo "❌ Download failed: ${download_url}"
|
||||
FAILED_PATCHES+=("${name} (download failed)")
|
||||
return 1
|
||||
fi
|
||||
apply-patch "${name}" "$d/repos/${target}" "$d/patching/${patch_file}"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user