From: alex <> Date: Mon, 8 Dec 2025 09:09:40 +0000 (+0100) Subject: fix aoc script X-Git-Url: https://aoc.elinar.fr/?a=commitdiff_plain;h=ff40f2a398ac02c16029f0438b65ccc0e7bba17f;p=aoc_2025 fix aoc script Numbers where seen as octal numbers. --- diff --git a/aoc b/aoc index 964beb4..ba85a25 100755 --- a/aoc +++ b/aoc @@ -24,14 +24,14 @@ get_input() { read_cookie curl -o input/$DAY.txt \ -H "Cookie: session=$COOKIE" \ - "https://adventofcode.com/2025/day/$(printf "%d" ${DAY/day/})/input" + "https://adventofcode.com/2025/day/${N}/input" } get_html() { read_cookie curl -o html/$DAY.html \ -H "Cookie: session=$COOKIE" \ - "https://adventofcode.com/2025/day/$(printf "%d" ${DAY/day/})" + "https://adventofcode.com/2025/day/${N}" } do_test() { @@ -66,6 +66,8 @@ done while [ $# -ge 1 ]; do DAY=$1 echo "day: $DAY" + N=${DAY/day0/} + N=${N/day/} [ $DO_HTML -eq 1 ] && get_html [ $DO_INPUT -eq 1 ] && get_input [ $DO_RUN -eq 1 ] && do_run