summaryrefslogtreecommitdiff
path: root/lib/atomfeed.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-08-24 19:41:47 +0300
committerPaul Buetow <paul@buetow.org>2024-08-24 19:41:47 +0300
commita7370ba21f9b4be497dcb10f47265d6eb9532819 (patch)
tree3dad476456beb8867a5d889d0f8aac30100b086d /lib/atomfeed.source.sh
parentbcdc16d4e59af05a07846ed704e3f75a122cd643 (diff)
check atomfeed before publishing
Diffstat (limited to 'lib/atomfeed.source.sh')
-rw-r--r--lib/atomfeed.source.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/atomfeed.source.sh b/lib/atomfeed.source.sh
index 079c2fb..53e54d5 100644
--- a/lib/atomfeed.source.sh
+++ b/lib/atomfeed.source.sh
@@ -91,6 +91,18 @@ ATOMFOOTER
fi
}
+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"
+ fi
+ find $CONTENT_BASE_DIR -name atom.xml | while read -r atom_xml; do
+ atomfeed::xmllint "$atom_xml"
+ done
+
+ log INFO "Atom feed/s seem fine"
+}
+
atomfeed::_entry () {
local -r gemfeed_dir="$1"; shift
local -r gmi_file="$1"; shift
@@ -151,7 +163,7 @@ atomfeed::xmllint () {
local -r atom_feed="$1"
if [ -n "$XMLLINT" ]; then
- log INFO 'XMLLinting Atom feed'
+ log INFO "XMLLinting Atom feed $atom_feed"
if ! $XMLLINT "$atom_feed" >/dev/null; then
log PANIC "Atom feed $atom_feed isn't valid XML, please re-try"
return 2