AOC2023: Add script to create day template and download input

This commit is contained in:
2023-12-23 18:46:14 +02:00
parent 762d575d70
commit 2faf90bc2b
4 changed files with 85 additions and 3 deletions

15
userspace/aoc2023/init-day.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
if [[ -z $1 ]]; then
echo Please specify day number >& 2
exit 1
fi
if [[ ! -d day$1 ]]; then
cp -r day-template day$1
sed -i "s/day-template/day$1/g" day$1/*
fi
if [[ ! -f input/day$1_input.txt ]]; then
wget --no-cookies --header "Cookie: session=$AOC_SESSION" https://adventofcode.com/2023/day/$1/input -O input/day$1_input.txt
fi