From 9cab3f83cc3ca23af1faafee2f58b830f80b074a Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Wed, 25 Nov 2026 11:28:19 +0000 Subject: [PATCH] fix(hpc/sync): keep pulling after the first extracted archive `unzip ... && (( zip_count++ ))` returns 1 when zip_count is 0, so under `set -euo pipefail` pull and pull-full exited 1 after the first archive, skipping the rest and any later PULL_DIRS roots. Branch on unzip explicitly and increment with zip_count=$(( zip_count + 1 )), as autolens_profiling (0dcc528f) does; a failed unzip now prints a WARNING and the pull goes on. Refs PyAutoLabs/autolens_assistant#189 Co-Authored-By: Claude Opus 5.5 --- hpc/sync | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/hpc/sync b/hpc/sync index 85ec334..96a87ae 100755 --- a/hpc/sync +++ b/hpc/sync @@ -257,7 +257,15 @@ pull() { while IFS= read -r -d '' zipfile; do local target="${zipfile%.zip}" if [[ ! -d "$target" ]]; then - unzip -q -o "$zipfile" -d "$target" && (( zip_count++ )) + # Not `&& (( zip_count++ ))`: at zip_count=0 that arithmetic returns 1 + # and `set -e` aborts the whole pull after the first archive, so later + # archives and later PULL_DIRS roots are never reached. `|| true` would + # hide a real unzip failure instead, so branch explicitly and say so. + if unzip -q -o "$zipfile" -d "$target"; then + zip_count=$(( zip_count + 1 )) + else + echo " WARNING: could not unzip ${zipfile}" + fi fi done < <(find "${PROJECT_ROOT}/${dir}" -name '*.zip' -print0 2>/dev/null) fi @@ -293,7 +301,15 @@ pull_full() { while IFS= read -r -d '' zipfile; do local target="${zipfile%.zip}" if [[ ! -d "$target" ]]; then - unzip -q -o "$zipfile" -d "$target" && (( zip_count++ )) + # Not `&& (( zip_count++ ))`: at zip_count=0 that arithmetic returns 1 + # and `set -e` aborts the whole pull after the first archive, so later + # archives and later PULL_DIRS roots are never reached. `|| true` would + # hide a real unzip failure instead, so branch explicitly and say so. + if unzip -q -o "$zipfile" -d "$target"; then + zip_count=$(( zip_count + 1 )) + else + echo " WARNING: could not unzip ${zipfile}" + fi fi done < <(find "${PROJECT_ROOT}/${dir}" -name '*.zip' -print0 2>/dev/null) echo " extracted ${zip_count} archive(s)"