diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-12 20:42:48 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-12 20:42:48 +0200 |
| commit | 7038b0fb8fff84124492701cf37f653f62efaaeb (patch) | |
| tree | fa9b77a22cac00efe63198d8d7e7e36244c5d812 | |
| parent | 1737b1c8309a6418552f3d5be9871e88637c3afc (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-x | gemtexter | 1 | ||||
| -rw-r--r-- | lib/atomfeed.source.sh | 3 |
2 files changed, 3 insertions, 1 deletions
@@ -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" |
