AdventOfCode2022/new.sh

16 lines
434 B
Bash
Raw Normal View History

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
curl -s -H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${1##0}/input > "${padded}/inputs/input"
fi
2022-12-01 12:33:12 +00:00
if [ ! -f "${padded}/main.rs" ]; then
cp -n main.rs.tmpl ${padded}/main.rs
2022-12-01 12:09:27 +00:00
fi
fi