add getday.sh
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Ben Harris 2021-12-01 01:00:18 -05:00
parent f583401da3
commit 898b2c4890
2 changed files with 14 additions and 0 deletions

1
aoc2021/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
session_cookie.txt

13
aoc2021/getday.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
. ./session_cookie.txt
if [ -z "$session" ]; then
printf "missing session cookie\n"
fi
curl -s https://adventofcode.com/2021/day/"$1"/input \
--cookie "session=$session" \
-o "$(printf "input/day%02d.in" "$1")"
sed "s/XX/$1/g" DayXX.cs.txt > "$(printf "Day%02d.cs" "$1")"