Skip to content

Commit

Permalink
diary tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
anlutro committed May 15, 2024
1 parent fe824cd commit 10b67cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/diary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ tmpfile=$DIARY_FILE.draft
vim -c 'setlocal tw=79' $tmpfile

if [ -e $tmpfile ] && [ -s $tmpfile ]; then
dt=$(date -R)
if [ -s "$DIARY_FILE" ]; then
printf "\n\n" >> "$DIARY_FILE"
fi
echo "===== $(date -R) =====" >> "$DIARY_FILE"
echo "===== $dt =====" >> "$DIARY_FILE"
cat $tmpfile >> "$DIARY_FILE"
echo "Appended entry to $DIARY_FILE"
echo "Appended entry to $DIARY_FILE ($dt)"
else
echo "Entry file empty, not doing anything"
fi
Expand Down

0 comments on commit 10b67cc

Please sign in to comment.