diff --git a/gemlog.sh b/gemlog.sh index b4e2bbc..a34b902 100755 --- a/gemlog.sh +++ b/gemlog.sh @@ -42,7 +42,7 @@ get_post_title() { } make_atom() { - echo "Making Atom" + echo "Bulding atom feed..." atomfile="$gemlog_feed.$RANDOM" while [[ -f $atomfile ]]; do atomfile="$gemlog_feed.$RANDOM"; done @@ -88,7 +88,11 @@ EOF } build_entries() { - echo "Building entries" + echo "Building index..." + + indexfile="$index.$RANDOM" + while [[ -f $indexfile ]]; do indexfile="$index.$RANDOM"; done + { # header of the page (above the posts list) sed 's/$/\r/g' << 'EOF' @@ -124,7 +128,10 @@ EOF => https://tildegit.org/nytpu/gemlog.sh generated with gemlog.sh EOF - } 3>&1 >"$index" + } 3>&1 >"$indexfile" + + mv "$indexfile" "$index" + chmod 644 "$index" } toot() { @@ -133,6 +140,7 @@ toot() { read -r -p "do you want to toot the newest post? [y/N] " response if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]] then + echo "tooting..." # change this if you want the toot to have different content printf "new gemlog post: ${title}\n\ngemini://nytpu.com/gemlog/${filename}" | toot post fi