AutoYADM commit: 2025-04-23 02:00:05
This commit is contained in:
parent
091544deaa
commit
aa3140fe6a
1 changed files with 9 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue