diff options
author | Ben Sima <ben@bsima.me> | 2022-03-14 22:05:22 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2022-03-14 22:05:22 -0400 |
commit | 8f32ad9e8828d3daaecac2ce46a45d277bfa8633 (patch) | |
tree | 7e8e432e25f5e234ecb56694023b78700195b74f /z-edit-daily | |
parent | 71065cfad2345bf143fe99d8fc1fccce939af68f (diff) |
z: add daily edit and title search
Diffstat (limited to 'z-edit-daily')
-rwxr-xr-x | z-edit-daily | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/z-edit-daily b/z-edit-daily new file mode 100755 index 0000000..05da963 --- /dev/null +++ b/z-edit-daily @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# +# Return today's daily notes file. If it doesn't already exist, make it using the +# daily template. Must be executed from inside the notes directory. +# +DATEFMT="+%Y.%-m.%-d" +DATE=$(date $DATEFMT) +FILE="daily/$DATE" +if [[ ! -f "$FILE" ]]; then + cat templates/daily.md | sed "s/{{date:YYYY.M.D}}/$DATE/" > $FILE +fi +echo "$FILE" |