mirror of
https://github.com/Noratrieb/advent-of-code.git
synced 2026-01-14 17:45:02 +01:00
2022 day01
This commit is contained in:
parent
fd2ea0612b
commit
e153ec51cd
20 changed files with 3180 additions and 82 deletions
7
aoc.sh
7
aoc.sh
|
|
@ -10,16 +10,17 @@ function get_cookie {
|
|||
cat aoc_cookie
|
||||
}
|
||||
|
||||
year=2022
|
||||
: "${1:?usage: ./aoc.sh new}"
|
||||
|
||||
case "$1" in
|
||||
new)
|
||||
: "${2:?usage: ./aoc.sh new DAY}"
|
||||
day="$(printf %02d "$2")"
|
||||
cp -r "2023/day00" "2023/day$day"
|
||||
find "2023/day$day" -type f -exec sed -i -e "s/00/$day/g" {} \;
|
||||
cp -r "$year/day00" "$year/day$day"
|
||||
find "$year/day$day" -type f -exec sed -i -e "s/00/$day/g" {} \;
|
||||
|
||||
curl -H "Cookie: $(get_cookie)" "https://adventofcode.com/2023/day/$2/input" -o "2023/day$day/input.txt"
|
||||
curl -H "Cookie: $(get_cookie)" "https://adventofcode.com/$year/day/$2/input" -o "$year/day$day/input.txt"
|
||||
;;
|
||||
*)
|
||||
echo "usage: ./aoc.sh new" >&2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue