From 2277d0ad7d541bba3ab652c4a0e607566f465e07 Mon Sep 17 00:00:00 2001 From: Ayo Date: Sat, 21 Jun 2025 13:10:39 +0200 Subject: [PATCH] refactor: format & comment --- new_journal.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/new_journal.sh b/new_journal.sh index 0519cc5..c11bda0 100755 --- a/new_journal.sh +++ b/new_journal.sh @@ -4,7 +4,6 @@ echo "NEW NOTE" journal_dir="/home/ayo/notes/Journal" -date_today=$(date +'%m-%d-%Y') file_name=$(date +'%m.%d.%Y').md month_dir=$(date +"%m %b") full_path="${journal_dir}/${month_dir}/${file_name}" @@ -12,12 +11,14 @@ full_path="${journal_dir}/${month_dir}/${file_name}" # IF Not Exists: create file & echo date if ! test -f "$full_path"; then install -Dv /dev/null $full_path - echo writing $date_today to "$full_path" - echo $date_today > "$full_path" + # TODO: update to correct heading from old entries + heading=$(date +'%m-%d-%Y') + echo writing $heading to "$full_path" + echo $heading > "$full_path" fi +# Open in editor vim "$full_path" - -# report, write log +# Report; TODO: write log echo ">>> " $month_dir / $file_name