diff options
| author | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2025-12-03 13:11:09 +0200 |
|---|---|---|
| committer | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2025-12-03 13:11:09 +0200 |
| commit | e2f449b4930ba4ffa7f42235dabcbc344c644d72 (patch) | |
| tree | c253e4acf1ef3033c39b864ed566fb537fa48454 /init.sh | |
| parent | initial commit (diff) | |
| download | aoc25-e2f449b4930ba4ffa7f42235dabcbc344c644d72.tar.gz aoc25-e2f449b4930ba4ffa7f42235dabcbc344c644d72.zip | |
add day initialization script
Diffstat (limited to 'init.sh')
| -rwxr-xr-x | init.sh | 19 |
1 files changed, 19 insertions, 0 deletions
| @@ -0,0 +1,19 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | if [ ! $# -eq 1 ] | ||
| 4 | then | ||
| 5 | echo "Usage: $0 <day>" | ||
| 6 | exit 1 | ||
| 7 | fi | ||
| 8 | |||
| 9 | ADVENT_YEAR=2025 | ||
| 10 | ADVENT_DAY=$1 | ||
| 11 | ADVENT_SESSION=$(cat ../cookie) | ||
| 12 | |||
| 13 | DIR=$(printf "day%02d" $ADVENT_DAY) | ||
| 14 | echo "Initializing directory $DIR/" | ||
| 15 | rsync -av --ignore-existing skel/ ${DIR}/ | ||
| 16 | |||
| 17 | echo "Downloading input ..." && | ||
| 18 | curl "https://adventofcode.com/$ADVENT_YEAR/day/$ADVENT_DAY/input" \ | ||
| 19 | -H "Cookie: session=$ADVENT_SESSION" > $DIR/input.txt | ||
