diff options
Diffstat (limited to 'wd-journal')
-rwxr-xr-x | wd-journal | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -3,12 +3,15 @@ year=$(date +%Y) week_number=$(date +%W) -title="## $(date '+%Y-%m-%d %A')" +overall_title="# Week $week_number $year" +today_title="## $(date '+%Y-%m-%d %A')" weekly_journal="$WD_JOURNALS_DIR/$year/week$week_number.md" -if ! grep -q "$title" "$weekly_journal"; then - echo "$title" >> "$weekly_journal" +[ ! -f "$weekly_journal" ] && echo "$overall_title" > "$weekly_journal" + +if ! grep -q "$today_title" "$weekly_journal"; then + echo "$today_title" >> "$weekly_journal" fi $EDITOR "$WD_JOURNALS_DIR/$year/week$week_number.md" |