diff options
author | Alexey Shpakovsky <alexey@shpakovsky.ru> | 2014-06-28 17:18:24 +0200 |
---|---|---|
committer | Alexey Shpakovsky <alexey@shpakovsky.ru> | 2014-06-28 17:18:24 +0200 |
commit | a5a196773a1e726da18fd2e76122467b58816283 (patch) | |
tree | 31be4fecfa446e66be98db29c4e56667b49cb58a /bb.sh | |
parent | 93808a0254055506918c278ea796508ede8a5075 (diff) |
suppress error messages and don't enter for loop when no tag files exist
Diffstat (limited to 'bb.sh')
-rwxr-xr-x | bb.sh | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -720,7 +720,7 @@ all_tags() { echo "<h3>$template_tags_title</h3>" >> "$contentfile" echo "<ul>" >> "$contentfile" - for i in ./$prefix_tags*.html; do + for i in $(ls ./$prefix_tags*.html 2>/dev/null || echo ''); do echo -n "." nposts="$(grep -c "<\!-- text begin -->" $i)" tagname="$(echo $i | cut -c $((${#prefix_tags}+3))- | sed 's/\.html//g')" @@ -837,7 +837,7 @@ rebuild_tags() { rm "$tmpfile" done # Now generate the tag files with headers, footers, etc - for i in $(ls -t ./$prefix_tags*.tmp.html); do + for i in $(ls -t ./$prefix_tags*.tmp.html 2>/dev/null || echo ''); do tagname="$(echo $i | cut -c $((${#prefix_tags}+3))- | sed 's/\.tmp\.html//g')" create_html_page "$i" "$prefix_tags$tagname.html" yes "$global_title — $template_tag_title \"$tagname\"" rm "$i" |