refactor: format & comment

This commit is contained in:
Ayo Ayco 2025-06-21 13:10:39 +02:00
parent 4cfbadbe20
commit 2277d0ad7d

View file

@ -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