AutoYADM commit: 2025-04-23 01:45:06
This commit is contained in:
parent
7c1f0cfa88
commit
091544deaa
1 changed files with 7 additions and 1 deletions
|
@ -89,7 +89,13 @@ function jrnl --description 'Lightweight journaling tool'
|
|||
set entry "$jdir/$today.md"
|
||||
# check if journal entry exists
|
||||
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
|
||||
set -l prompt "Created $entry, open in $EDITOR? (y/n)"
|
||||
while read --nchars 1 -l response --prompt-str="$prompt" or return 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue