From: alex <> Date: Sun, 8 Dec 2024 07:33:17 +0000 (+0100) Subject: Règle pour récupérer l’input X-Git-Url: https://aoc.elinar.fr/?a=commitdiff_plain;h=f181d2d706f44dfdb4f49203312cc3a013636ed0;p=aoc_2024 Règle pour récupérer l’input Nécessite un fichier .cookie avec le cookie de session. --- diff --git a/.gitignore b/.gitignore index 05cc302..ae5fb86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ Cargo.lock /target +.cookie + *.sw* diff --git a/Makefile b/Makefile index 57a9883..7e9bc59 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,16 @@ new-day%: -e "/_ =>/i\ \"$(subst new-,,$@)\" => $(subst new-,,$@)::run(\&input)?," \ src/main.rs +# Requires a .cookie file +# do not use leading 0 +# make input-1 +# make input-10 +input-%: + [ ! -f .cookie ] && echo "Missing .cookie file" && return 1 || true + curl -o input/day$$(printf "%02d" $(subst input-,,$@)).txt \ + -H "Cookie: session=$$(cat .cookie)" \ + "https://adventofcode.com/2024/day/$(subst input-,,$@)/input" + # run the tests for a specific day test-day%: cargo test $(subst test-,,$@)::tests -- --nocapture