diff --git a/scripts/countdown b/scripts/countdown index 30af200..fa320da 100755 --- a/scripts/countdown +++ b/scripts/countdown @@ -7,12 +7,11 @@ export TZ="America/New_York" function init_day { day=$(($(date +%-d))) - if [ ! -f $day.rkt ]; then + if [ ! -f inputs/$day ]; then set -m scripts/get-challenge $day & sleep 1 - scripts/make-day $day - tmux split-pane -v -- "bash -li <<< 'watch $day; execstring template) (hash 'day day) out))) - ;; get input - (define in (aoc-fetch-input (getenv "AOC_YEAR") day (getenv "AOC_SESSION"))) - (call-with-output-file (build-path "inputs" day) (lambda (out) (copy-port in out)))) + (eval-template (path->string template) (hash 'day day) out))))