summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-05 22:51:56 +0300
committerPaul Buetow <paul@buetow.org>2026-06-05 22:51:56 +0300
commitce3c1f9ffeffc0b57f46fc21ff1505581d0d199e (patch)
treebe1a9094abc091209178d0e656bc8809ce36054e /src
parent1e1287b7ddbbda6602296c323d72d72024dd9caa (diff)
Fix tarball cleanup for custom suffixes
Diffstat (limited to 'src')
-rwxr-xr-xsrc/photoalbum.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/photoalbum.sh b/src/photoalbum.sh
index ae8b01d..afa4ae9 100755
--- a/src/photoalbum.sh
+++ b/src/photoalbum.sh
@@ -345,11 +345,18 @@ run_with_timeout() {
tarball() {
local -r tarball_name="$1"; shift
+ local -r tarball_suffix="${TARBALL_SUFFIX:-.tar}"
local base
+ local old_tarball
local -a tar_opts=()
- # Cleanup tarball from prev run if any
- find "$DIST_DIR" -maxdepth 1 -type f -name '*.tar' -delete
+ # Cleanup tarballs from previous runs for the configured suffix.
+ while IFS= read -r -d '' old_tarball; do
+ if [[ "$old_tarball" == *"$tarball_suffix" ]]; then
+ rm -f "$old_tarball"
+ fi
+ done < <(find "$DIST_DIR" -maxdepth 1 -type f -print0)
+
base=$(basename "$INCOMING_DIR")
resolve_tar_opts tar_opts