AdventOfCode2019/new.sh

16 lines
434 B
Bash
Executable File

#!/bin/bash
__year=2019
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
if [ ! -f "${padded}/main.go" ]; then
cp -n main.go.tmpl ${padded}/main.go
fi
fi