#!/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.md" if [[ ! -f "$FILE" ]]; then cat templates/daily.md | sed "s/{{date:YYYY.M.D}}/$DATE/" > $FILE fi echo "$FILE"