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,10 +89,15 @@ function jrnl --description 'Lightweight journaling tool'
set entry "$jdir/$today.md"
# check if journal entry exists
if not test -f $entry
set contents (cat $template | \
string match --invert --regex '^<!--.*-->' | \
string replace --all '%{date}' "$(date +'%A, %b %d, %Y')" | \
string collect -N)
set lines (cat $template)
while test -z "$lines[-1]"
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 )
echo $contents
return 0
# set contents (string join \n "# $today" "$(tail -n +2 $template)" | string collect -N)