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".