refactor: format & comment
This commit is contained in:
parent
4cfbadbe20
commit
2277d0ad7d
1 changed files with 6 additions and 5 deletions
|
@ -4,7 +4,6 @@ echo "NEW NOTE"
|
||||||
|
|
||||||
journal_dir="/home/ayo/notes/Journal"
|
journal_dir="/home/ayo/notes/Journal"
|
||||||
|
|
||||||
date_today=$(date +'%m-%d-%Y')
|
|
||||||
file_name=$(date +'%m.%d.%Y').md
|
file_name=$(date +'%m.%d.%Y').md
|
||||||
month_dir=$(date +"%m %b")
|
month_dir=$(date +"%m %b")
|
||||||
full_path="${journal_dir}/${month_dir}/${file_name}"
|
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 Not Exists: create file & echo date
|
||||||
if ! test -f "$full_path"; then
|
if ! test -f "$full_path"; then
|
||||||
install -Dv /dev/null $full_path
|
install -Dv /dev/null $full_path
|
||||||
echo writing $date_today to "$full_path"
|
# TODO: update to correct heading from old entries
|
||||||
echo $date_today > "$full_path"
|
heading=$(date +'%m-%d-%Y')
|
||||||
|
echo writing $heading to "$full_path"
|
||||||
|
echo $heading > "$full_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Open in editor
|
||||||
vim "$full_path"
|
vim "$full_path"
|
||||||
|
|
||||||
|
# Report; TODO: write log
|
||||||
# report, write log
|
|
||||||
echo ">>> " $month_dir / $file_name
|
echo ">>> " $month_dir / $file_name
|
||||||
|
|
Loading…
Reference in a new issue