From 7038b0fb8fff84124492701cf37f653f62efaaeb Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 12 Mar 2026 20:42:48 +0200 Subject: atomfeed: clean up stale .xml.tmp files on fresh run instead of panicking When xmllint fails, the .xml.tmp file is kept for investigation. On the next --generate run, atomfeed::verify now warns and removes stale .xml.tmp files instead of panicking. Amp-Thread-ID: https://ampcode.com/threads/T-019ce359-d9d5-7119-8035-c635724c1047 Co-authored-by: Amp --- gemtexter | 1 + lib/atomfeed.source.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gemtexter b/gemtexter index 2ab26f7..1344f95 100755 --- a/gemtexter +++ b/gemtexter @@ -164,6 +164,7 @@ main () { if [ -x "$PRE_GENERATE_HOOK" ]; then $PRE_GENERATE_HOOK fi + atomfeed::verify template::generate log INFO 'Generating feeds - this may will take a while' gemfeed::generate & diff --git a/lib/atomfeed.source.sh b/lib/atomfeed.source.sh index 1e39db7..1b71e2a 100644 --- a/lib/atomfeed.source.sh +++ b/lib/atomfeed.source.sh @@ -100,7 +100,8 @@ ATOMFOOTER atomfeed::verify () { if [ "$(find "$CONTENT_BASE_DIR" -name \*.xml.tmp | wc -l)" -ge 1 ]; then find "$CONTENT_BASE_DIR" -name \*.xml.tmp - log PANIC "Found incomplete Atom feed files with the suffix .xml.tmp" + log WARN "Found incomplete Atom feed files with the suffix .xml.tmp from a previous run, removing them" + find "$CONTENT_BASE_DIR" -name \*.xml.tmp -delete fi find "$CONTENT_BASE_DIR" -name atom.xml | while read -r atom_xml; do atomfeed::xmllint "$atom_xml" -- cgit v1.2.3