commit 7557d3b9071af21512af55c0a79da00197463abf parent 180c2f5ad008eebbb0ac99a846d0524ff2c2e02e Author: Sebastiano Tronto <sebastiano@tronto.net> Date: Mon, 1 Dec 2025 11:33:53 +0100 aoc: only download puzzle input if file is not present Diffstat:
| M | aoc | | | 6 | ++++-- |
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/aoc b/aoc @@ -19,8 +19,10 @@ daynozero="$(echo "$day" | sed 's/^0//')" cd "$basedir/$year/$day" # Download the puzzle input and save it to input.txt -url="https://adventofcode.com/$year/day/$daynozero/input" -curl "$url" -H "cookie: session=$AOC_SESSION_COOKIE" -o input.txt +if [ ! -e input.txt ]; then + url="https://adventofcode.com/$year/day/$daynozero/input" + curl "$url" -H "cookie: session=$AOC_SESSION_COOKIE" -o input.txt +fi # Open a tmux session with lynx in its own windows, and an editor and a # terminal in split view.