summaryrefslogtreecommitdiff
path: root/wd-journal
diff options
context:
space:
mode:
Diffstat (limited to 'wd-journal')
-rwxr-xr-xwd-journal9
1 files changed, 6 insertions, 3 deletions
diff --git a/wd-journal b/wd-journal
index 8022125..7f59649 100755
--- a/wd-journal
+++ b/wd-journal
@@ -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"