AdventOfCode2021/new.sh

16 lines
434 B
Bash
Raw Permalink 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
2021-12-06 14:22:08 +00:00
touch ${padded}/inputs/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