summaryrefslogtreecommitdiff
path: root/z-edit-daily
diff options
context:
space:
mode:
Diffstat (limited to 'z-edit-daily')
-rwxr-xr-xz-edit-daily12
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"