diff options
author | Guangxiong Lin <[email protected]> | 2022-11-01 10:13:24 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-11-01 10:13:24 +0800 |
commit | 9d806fd9bf0f84a1362884d289896ab220395e5a (patch) | |
tree | f0b4d2c44559a72c52bd78c322a59e9c0c96cc15 | |
parent | 88985762ec88f51fb8aa89cf115b4a822a87f0b0 (diff) | |
download | wd-9d806fd9bf0f84a1362884d289896ab220395e5a.tar.gz wd-9d806fd9bf0f84a1362884d289896ab220395e5a.tar.bz2 wd-9d806fd9bf0f84a1362884d289896ab220395e5a.zip |
Add create journal file flowv0.0.4
-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" |