AutoYADM commit: 2025-04-23 01:45:06

This commit is contained in:
Daniel Fichtinger 2025-04-23 01:45:06 -04:00
parent 7c1f0cfa88
commit 091544deaa

View file

@ -89,7 +89,13 @@ 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) set contents (cat $template | \
string match --invert --regex '^<!--.*-->' | \
string replace --all '%{date}' "$(date +'%A, %b %d, %Y')" | \
string collect -N)
echo $contents
return 0
# 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