summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-12 20:42:48 +0200
committerPaul Buetow <paul@buetow.org>2026-03-12 20:42:48 +0200
commit7038b0fb8fff84124492701cf37f653f62efaaeb (patch)
treefa9b77a22cac00efe63198d8d7e7e36244c5d812
parent1737b1c8309a6418552f3d5be9871e88637c3afc (diff)
atomfeed: clean up stale .xml.tmp files on fresh run instead of panickingmain
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 <amp@ampcode.com>
-rwxr-xr-xgemtexter1
-rw-r--r--lib/atomfeed.source.sh3
2 files changed, 3 insertions, 1 deletions
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"