diff --git a/cron.sh b/cron.sh index 53a7f92..3c3585d 100755 --- a/cron.sh +++ b/cron.sh @@ -1,6 +1,9 @@ #!/bin/bash set -euo pipefail +# install me in your crontab! +# 0 5 1-25 12 * $HOME/adventofcode2023/cron.sh auto + year=2023 root=~/adventofcode${year} @@ -40,7 +43,11 @@ if test -e "$dir"; then exit 1 fi -cwd=${PWD:-`pwd`} +if ! test -e "$root/cookie"; then + echo >&2 "warning: cookiefile '$root/cookie' not found. consider creating it" +fi + +cwd=${PWD:-$(pwd)} mkdir "$dir" cd "$dir" || exit 1