2021-11-30 23:51:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-12-01 01:10:44 +00:00
|
|
|
__year=2021
|
|
|
|
|
2021-11-30 23:51:56 +00:00
|
|
|
if [ "${1}" != "" ]; then
|
2021-12-01 01:10:44 +00:00
|
|
|
padded=$(printf "%02g" ${1})
|
|
|
|
mkdir -p ${padded}/inputs
|
|
|
|
touch ${padded}/inputs/{input,testinput}
|
2021-12-05 17:41:14 +00:00
|
|
|
if [ ! -f "${padded}/inputs/input" ]; then
|
|
|
|
curl -s -H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${1##0}/input > "${padded}/inputs/input"
|
|
|
|
fi
|
|
|
|
if [ ! -f "${padded}/main.go" ]; then
|
|
|
|
cp -n main.go.tmpl ${padded}/main.go
|
|
|
|
fi
|
2021-11-30 23:51:56 +00:00
|
|
|
fi
|