diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-01 11:33:53 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-01 11:33:53 +0100 |
| commit | 7557d3b9071af21512af55c0a79da00197463abf (patch) | |
| tree | 9e7322ee9f1a983ceb874747741ce415706b5d44 /aoc | |
| parent | 180c2f5ad008eebbb0ac99a846d0524ff2c2e02e (diff) | |
| download | scripts-7557d3b9071af21512af55c0a79da00197463abf.tar.gz scripts-7557d3b9071af21512af55c0a79da00197463abf.zip | |
aoc: only download puzzle input if file is not present
Diffstat (limited to 'aoc')
| -rwxr-xr-x | aoc | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -19,8 +19,10 @@ daynozero="$(echo "$day" | sed 's/^0//')" | |||
| 19 | cd "$basedir/$year/$day" | 19 | cd "$basedir/$year/$day" |
| 20 | 20 | ||
| 21 | # Download the puzzle input and save it to input.txt | 21 | # Download the puzzle input and save it to input.txt |
| 22 | url="https://adventofcode.com/$year/day/$daynozero/input" | 22 | if [ ! -e input.txt ]; then |
| 23 | curl "$url" -H "cookie: session=$AOC_SESSION_COOKIE" -o input.txt | 23 | url="https://adventofcode.com/$year/day/$daynozero/input" |
| 24 | curl "$url" -H "cookie: session=$AOC_SESSION_COOKIE" -o input.txt | ||
| 25 | fi | ||
| 24 | 26 | ||
| 25 | # Open a tmux session with lynx in its own windows, and an editor and a | 27 | # Open a tmux session with lynx in its own windows, and an editor and a |
| 26 | # terminal in split view. | 28 | # terminal in split view. |
