2022-12-01 12:09:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
__year=2022
|
|
|
|
|
|
|
|
if [ "${1}" != "" ]; then
|
|
|
|
padded=$(printf "%02g" ${1})
|
|
|
|
mkdir -p ${padded}/inputs
|
|
|
|
touch ${padded}/inputs/testinput
|
|
|
|
if [ ! -f "${padded}/inputs/input" ]; then
|
2022-12-01 13:07:30 +00:00
|
|
|
curl -s \
|
|
|
|
-A "https://git.yetaga.in/alazyreader/AdventOfCode2022/" \
|
|
|
|
-H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${1##0}/input > "${padded}/inputs/input"
|
2022-12-01 12:09:27 +00:00
|
|
|
fi
|
2022-12-19 02:15:26 +00:00
|
|
|
# if [ ! -f "${padded}/main.rs" ]; then
|
|
|
|
# cp -n main.rs.tmpl ${padded}/main.rs
|
|
|
|
# fi
|
2022-12-17 23:13:43 +00:00
|
|
|
if [ ! -f "${padded}/main.go" ]; then
|
|
|
|
cp -n main.go.tmpl ${padded}/main.go
|
|
|
|
fi
|
2022-12-03 12:01:53 +00:00
|
|
|
echo "https://adventofcode.com/2022/day/${1}"
|
2022-12-01 12:09:27 +00:00
|
|
|
fi
|