From 31310f9d5fe88937ca09d48270f94f36999e8631 Mon Sep 17 00:00:00 2001 From: Antoine Date: Wed, 4 Dec 2024 13:32:40 +0100 Subject: [PATCH] added aoc --- local/bin/dn | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/local/bin/dn b/local/bin/dn index b663811..3220936 100755 --- a/local/bin/dn +++ b/local/bin/dn @@ -5,6 +5,8 @@ today=$(date +%d-%m-%Y) daily_note_dir="$NOTES_DIR/daily_notes" today_file="${daily_note_dir}/${today}_daily.md" most_recent_file=$(ls -t ${daily_note_dir}/*_daily.md | head -n 1) +month=$(date +%m) +day=$(date +%d) # Function to find unticked checkboxes in the most recent daily note find_unticked_checkboxes() { @@ -15,6 +17,13 @@ find_unticked_checkboxes() { fi } +# Function to add aoc checkbox if it's December before the 24th +add_aoc_checkbox() { + if [[ "$month" -eq "12" && "$day" -lt "25" ]]; then + echo "- [ ] Advent of Code" + fi +} + # Check if today's daily note exists if [[ -f "$today_file" ]]; then echo "Today's daily note already exists. Opening with neovim..." @@ -28,6 +37,7 @@ else echo "---" echo "# To-Do" find_unticked_checkboxes + add_aoc_checkbox # echo "- [ ]" echo "" echo "# Logbook"