diff --git a/new.sh b/new.sh index d5556cc..f0f4cf7 100755 --- a/new.sh +++ b/new.sh @@ -6,6 +6,10 @@ if [ "${1}" != "" ]; then padded=$(printf "%02g" ${1}) mkdir -p ${padded}/inputs touch ${padded}/inputs/{input,testinput} - curl -s -H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${1##0}/input > "${padded}/inputs/input" - cp -n main.go.tmpl ${padded}/main.go + 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