From 4e25c25f085fb994d8da494d3cbbf574f787cf78 Mon Sep 17 00:00:00 2001 From: klea Date: Sat, 14 Feb 2026 17:16:41 +0000 Subject: git-archive: improve error handling --- bin/git-archive | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/git-archive b/bin/git-archive index 2cce48e..9007c77 100755 --- a/bin/git-archive +++ b/bin/git-archive @@ -35,15 +35,18 @@ while IFS='' read -r url; do urlwp="$work_dir/$urlp" { unset HOME XDG_CONFIG_HOME SSH_ASKPASS GIT_ASKPASS + set +e echo "$ git clone --mirror $url $urlp" - USER=archiveteam-codearchiver-runner ftime git -c 'core.sshCommand=ssh -F /dev/null -o "UserKnownHostsFile /dev/null" -o "IdentitiesOnly yes" -o "StrictHostKeyChecking no"' -c 'credential.interactive=false' clone --mirror "$url" "$urlwp" || true + USER=archiveteam-codearchiver-runner ftime git -c 'core.sshCommand=ssh -F /dev/null -o "UserKnownHostsFile /dev/null" -o "IdentitiesOnly yes" -o "StrictHostKeyChecking no"' -c 'credential.interactive=false' clone --mirror "$url" "$urlwp" echo "$ GIT_DIR=$urlp git bundle create $urlp.bundle --all" - USER=archiveteam-codearchiver-runner GIT_DIR=$urlwp ftime git bundle create "$urlwp.bundle" --all || true + USER=archiveteam-codearchiver-runner GIT_DIR=$urlwp ftime git bundle create "$urlwp.bundle" --all [ "$?" = "0" ] && { echo "$ rm --recursive --force $urlp" - USER=archiveteam-codearchiver-runner rm --recursive --force "$urlwp" || true + USER=archiveteam-codearchiver-runner rm --recursive --force "$urlwp" } + set -e } 2>&1 | tee "$urlwp.log" + sed -i $'s\1'"$work_dir"$'\1'"/archive/"$'\1g' "$urlwp.log" zstd --rm -19 "$urlwp.log" done -- cgit v1.3.1-10-gc9f91