AdventOfCode2021/new.sh

16 lines
442 B
Bash
Raw Normal View History

2021-11-30 23:51:56 +00:00
#!/bin/bash
__year=2021
2021-11-30 23:51:56 +00:00
if [ "${1}" != "" ]; then
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