Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions hpc/sync
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)"
Expand Down
Loading