From 1d67604df4306d9eecaa11d81fe3fa0e02308e5a Mon Sep 17 00:00:00 2001 From: p4bl0 Date: Sun, 26 Feb 2012 14:11:36 +0100 Subject: fix live update bug for real ^^' (thx a3nm) --- html-gen.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/html-gen.sh b/html-gen.sh index b1f0e41..73c712f 100644 --- a/html-gen.sh +++ b/html-gen.sh @@ -362,6 +362,7 @@ for f in $deleted_files; do done if [ $modification -gt 0 ]; then + temp=`mktemp fugitiveXXXXXX` echo -n "[fugitive] Generating $public_dir/archives.html... " cat "$templates_dir/archives.html" | \ replace_includes | \ @@ -371,7 +372,8 @@ if [ $modification -gt 0 ]; then replace_str "page_title" "archives" | \ replace_str "blog_url" "$blog_url" | \ replace_commit_info "-1" | \ - sed "/^[[:space:]]*$/d" > "$public_dir/archives.html" + sed "/^[[:space:]]*$/d" > "$temp" + cp "$temp" "$public_dir/archives.html" echo "done." echo -n "[fugitive] Generating $public_dir/feed.xml... " last_5_articles=`mktemp fugitiveXXXXXX` @@ -385,9 +387,10 @@ if [ $modification -gt 0 ]; then replace_str "page_title" "feed" | \ replace_str "blog_url" "$blog_url" | \ replace_commit_info "-1" | \ - sed "/^[[:space:]]*$/d" > "$public_dir/feed.xml" + sed "/^[[:space:]]*$/d" > "$temp" + cp "$temp" "$public_dir/feed.xml" echo "done." - rm "$last_5_articles" "$last_5_commits" + rm "$last_5_articles" "$last_5_commits" "$temp" echo -n "[fugitive] Using last published article as index page... " cp "$public_dir/`head -1 $articles_sorted`.html" "$public_dir/index.html" echo "done". -- cgit v1.2.3