aboutsummaryrefslogtreecommitdiff
path: root/fetch-inputs
diff options
context:
space:
mode:
authorThomas Voss <thomas.voss@humanwave.nl> 2025-12-09 10:49:51 +0100
committerThomas Voss <thomas.voss@humanwave.nl> 2025-12-09 10:49:51 +0100
commite7c62d0e7f89df0bbb8ab8bff019671aa2933b86 (patch)
tree23e4dd614167f6d8a5e05313ec2aa530a8c2ca56 /fetch-inputs
parentaabaee2b1c625ab17ab3149d36e2042301174df9 (diff)
Make fetch-inputs MacOS-friendly
Diffstat (limited to 'fetch-inputs')
-rwxr-xr-xfetch-inputs7
1 files changed, 4 insertions, 3 deletions
diff --git a/fetch-inputs b/fetch-inputs
index 4c3b00e..3509e89 100755
--- a/fetch-inputs
+++ b/fetch-inputs
@@ -2,12 +2,13 @@
cd "$(dirname "$0")"
+
find . \
- -regextype egrep \
-mindepth 2 \
-maxdepth 2 \
-type d \
- -regex '\./[0-9]{4}/[0-9]{2}' \
+ -regex '\./[0-9]\{4\}/[0-9]\{2\}' \
+ | sort \
| while IFS=/ read _ y d
do
file=$y/$d/input
@@ -16,4 +17,4 @@ do
wget -q --load-cookies=.cookies -O "$file" \
"https://adventofcode.com/$y/day/${d#0}/input"
>&2 printf 'DONE\n' >&2
-done \ No newline at end of file
+done