From: Christian Heller Date: Mon, 2 Jan 2017 03:02:47 +0000 (+0100) Subject: Harden against lack of blog entries. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/foo.html?a=commitdiff_plain;h=a1eaed02a2a373d149239952dc515b759044d5c1;p=redo-blog Harden against lack of blog entries. --- diff --git a/processor/feed.xml.do b/processor/feed.xml.do index 19ba026..717fa89 100644 --- a/processor/feed.xml.do +++ b/processor/feed.xml.do @@ -60,8 +60,10 @@ printf "%s\n\n" "$lastmod_rfc3339" # Write feed entries. for file in ./${tmp_snippets_dir}/*; do - cat "${file}" - printf "\n" + if [ -e "$file" ]; then + cat "${file}" + printf "\n" + fi done rm -rf "$tmp_snippets_dir" diff --git a/processor/index.html.do b/processor/index.html.do index 105bc74..5149cac 100644 --- a/processor/index.html.do +++ b/processor/index.html.do @@ -29,9 +29,11 @@ done # Write link list. for file in ./${tmp_snippets_dir}/*; do - touch ./${tmp_snippets_dir}/list - cat "$file" ./${tmp_snippets_dir}/list > ./${tmp_snippets_dir}/tmp - mv ./${tmp_snippets_dir}/tmp ./${tmp_snippets_dir}/list + if [ -e "$file" ]; then + touch ./${tmp_snippets_dir}/list + cat "$file" ./${tmp_snippets_dir}/list > ./${tmp_snippets_dir}/tmp + mv ./${tmp_snippets_dir}/tmp ./${tmp_snippets_dir}/list + fi done if [ -e "./${tmp_snippets_dir}/list" ]; then list=$(cat ./${tmp_snippets_dir}/list | prep_sed)