added aoc
This commit is contained in:
parent
1c775e4a19
commit
31310f9d5f
1 changed files with 10 additions and 0 deletions
10
local/bin/dn
10
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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue