AutoYADM commit: 2025-04-23 01:30:05

This commit is contained in:
Daniel Fichtinger 2025-04-23 01:30:05 -04:00
parent 78a71ecbb7
commit 7c1f0cfa88

View file

@ -45,36 +45,38 @@ function jrnl --description 'Lightweight journaling tool'
switch $response switch $response
case y Y case y Y
begin begin
echo "# $(date +'%A, %b %d, %Y')"\n echo '# %{date}'\n
echo '<!-- Use the %{date} placeholder for the date. -->'
echo '<!-- Comments will be ignored. -->'
echo "## Gratitude"\n # echo "## Gratitude"\n
echo "I'm grateful for ..."\n # echo "I'm grateful for ..."\n
echo "## + Wins"\n # echo "## + Wins"\n
echo "- small_victories"\n # echo "- small_victories"\n
echo "## - Challenges"\n # echo "## - Challenges"\n
echo "- hard_things"\n # echo "- hard_things"\n
echo "## Reflection"\n # echo "## Reflection"\n
echo "_One sentence to reflect on today:_"\n # echo "_One sentence to reflect on today:_"\n
echo "- reflection"\n # echo "- reflection"\n
echo "## Learned"\n # echo "## Learned"\n
echo "- fact_insight_or_skill"\n # echo "- fact_insight_or_skill"\n
echo "## Tomorrow"\n # echo "## Tomorrow"\n
echo "- prep"\n # echo "- prep"\n
end >$template end >$template
eval $EDITOR $template eval $EDITOR $template
set -f new_template break
case n N case n N
break break
end end
@ -87,6 +89,7 @@ function jrnl --description 'Lightweight journaling tool'
set entry "$jdir/$today.md" set entry "$jdir/$today.md"
# check if journal entry exists # check if journal entry exists
if not test -f $entry if not test -f $entry
set contents (string join \n "# $today" "$(tail -n +2 $template)" | string collect -N)
cat $template >$entry cat $template >$entry
set -l prompt "Created $entry, open in $EDITOR? (y/n)" set -l prompt "Created $entry, open in $EDITOR? (y/n)"
while read --nchars 1 -l response --prompt-str="$prompt" or return 1 while read --nchars 1 -l response --prompt-str="$prompt" or return 1