diff options
author | Guangxiong Lin <[email protected]> | 2022-12-05 10:11:44 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-12-05 10:11:44 +0800 |
commit | 2d33970ce5daf2b75bef0959e67f60d94b6d7639 (patch) | |
tree | 7aabc3e375f20f67ad48ed32bdda0eafa5310b13 | |
parent | f58eb61d80dfc39e4ed33ca0680bd92736d4b452 (diff) | |
download | wd-0.0.8.tar.gz wd-0.0.8.tar.bz2 wd-0.0.8.zip |
-rwxr-xr-x | wd | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -51,8 +51,12 @@ cmd_journal () { local monthly_journal_title="# $(date '+%B %Y')" local monthly_journal_subtitle="## [Week $week_number $year]($year-week$week_number.md)" + local yearly_journal_title="# $(date '+%Y')" + local yearly_journal_subtitle="## [$(date '+%B')]($(date '+%Y-%m').md)" + local weekly_journal="$WD_JOURNALS_DIR/$year-week$week_number.md" local monthly_journal="$WD_JOURNALS_DIR/$(date '+%Y-%m').md" + local yearly_journal="$WD_JOURNALS_DIR/$(date '+%Y').md" local file_to_edit="$weekly_journal" local file_title="$weekly_journal_title" @@ -64,6 +68,11 @@ cmd_journal () { file_title="$monthly_journal_title" file_subtitle="$monthly_journal_subtitle" ;; + --yearly|-y) shift; + file_to_edit="$yearly_journal" + file_title="$yearly_journal_title" + file_subtitle="$yearly_journal_subtitle" + ;; esac [ ! -f "$file_to_edit" ] && echo "$file_title" > "$file_to_edit" |