From: Christian Heller Date: Mon, 2 Jan 2017 10:38:20 +0000 (+0100) Subject: To feed generator, add handler for case of empty blog. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bdb.prefix%7D%7D/%7B%7Bprefix%7D%7D/task?a=commitdiff_plain;h=cc2d161a6ef0700f6d08fd5c63314834a7264c28;p=redo-blog To feed generator, add handler for case of empty blog. --- diff --git a/processor/feed.xml.do b/processor/feed.xml.do index 717fa89..0bc7318 100644 --- a/processor/feed.xml.do +++ b/processor/feed.xml.do @@ -47,7 +47,11 @@ for file in ./*.rst ./*.md; do done # Derive feed modification date from snippets. -mod_dates=$(grep -hE "^" ./${metadata_dir}/*.feed_snippet | sed -E 's/<.?updated>//g') +n_snippet_files=`ls -1 ./${metadata_dir}/*.feed_snippet 2>/dev/null | wc -l` +if [ $n_snippet_files != 0 ] +then + mod_dates=$(grep -hE "^" ./${metadata_dir}/*.feed_snippet | sed -E 's/<.?updated>//g') +fi last_mod_unix=0 for date in $mod_dates; do date_unix=$(date -u "+%s" -d "${date}")