AutoYADM commit: 2025-04-23 02:00:05

This commit is contained in:
Daniel Fichtinger 2025-04-23 02:00:05 -04:00
parent 091544deaa
commit aa3140fe6a

View file

@ -89,9 +89,14 @@ 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 (cat $template | \ set lines (cat $template)
string match --invert --regex '^<!--.*-->' | \ while test -z "$lines[-1]"
string replace --all '%{date}' "$(date +'%A, %b %d, %Y')" | \ set -e lines[-1]
end
set contents ($lines |
string match --invert --regex '^<!--.*-->' |
string replace --all '%{date_long}' "$(date +'%A, %b %d, %Y')" |
string replace --all '%{date}' "$today" |
string collect -N ) string collect -N )
echo $contents echo $contents
return 0 return 0