diff --git a/html-gen.sh b/html-gen.sh index 4fff952..b1f0e41 100644 --- a/html-gen.sh +++ b/html-gen.sh @@ -288,6 +288,7 @@ replace_foreach () { } generate_article() { + temp=`mktemp fugitiveXXXXXX` art="${1#$articles_dir/}" title=`get_article_title "$art"` cat "$templates_dir/article.html" | \ @@ -296,7 +297,8 @@ generate_article() { replace_str "blog_url" "$blog_url" | \ replace_commit_info "-1" | \ replace_article_info "$art" | \ - sed "/^[[:space:]]*$/d" > "$public_dir/$art.html" + sed "/^[[:space:]]*$/d" > "$temp" + mv "$temp" "$public_dir/$art.html" } regenerate_previous_and_next_article_maybe() {