#!/bin/zsh

cd ~/docs/notes/dsa/louisville

today="$(date --iso-8601)"
current="$today.md"
previous="$(ls | sort | tail -n 1)"
previous_date="$(echo "$previous" | sed "s/.md//")"

if ! [ -e $current ]
then
     cp $previous $current
     sed -i "s/$previous_date/$today/g" $current
fi

nvim -c ":Copilot disable"  $current && cd -
