summaryrefslogtreecommitdiff
path: root/html-gen.sh
diff options
context:
space:
mode:
authorp4bl0 <r@uzy.me>2012-02-26 14:11:36 +0100
committerp4bl0 <r@uzy.me>2012-02-26 14:11:36 +0100
commit1d67604df4306d9eecaa11d81fe3fa0e02308e5a (patch)
treee403700817fbe58649c39560aff2f8184c6d0150 /html-gen.sh
parenta0487b63d9607a43787ae511b131d4065fd8c004 (diff)
fix live update bug for real ^^' (thx a3nm)
Diffstat (limited to 'html-gen.sh')
-rw-r--r--html-gen.sh9
1 files 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".