update scripts
This commit is contained in:
parent
1a2b3cfb9a
commit
be494d8bfd
|
@ -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; exec</dev/tty'"
|
||||
scripts/get-input $day
|
||||
fg
|
||||
return 1
|
||||
fi
|
||||
|
@ -21,6 +20,11 @@ function init_day {
|
|||
|
||||
if init_day; then
|
||||
next_day=$((day + 1))
|
||||
|
||||
if [ ! -f $next_day.rkt ]; then
|
||||
scripts/make-day $next_day
|
||||
fi
|
||||
|
||||
next_timestamp=$(date --date="$(date +%Y-%m)-$next_day" +%s)
|
||||
while true; do
|
||||
secs_left=$((next_timestamp - $(date +%s)))
|
||||
|
|
|
@ -25,7 +25,4 @@
|
|||
(call-with-output-file
|
||||
(format "~a.rkt" day)
|
||||
(lambda (out)
|
||||
(eval-template (path->string 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))))
|
||||
|
|
Loading…
Reference in New Issue