make the today script nicer

This commit is contained in:
2025-12-01 20:47:58 -05:00
parent b3521f6253
commit 4f6d8e5525

View File

@@ -8,12 +8,13 @@ if [ "${__day}" == "" ]; then
fi fi
padded=$(printf "%02g" ${__day}) padded=$(printf "%02g" ${__day})
mkdir -p src/resources/inputs/${padded} __resourceDir=src/resources/inputs/${padded}
touch src/resources/inputs/${padded}/testinput mkdir -p ${__resourceDir}
if [ ! -f "src/resources/inputs/${padded}/input" ]; then touch ${__resourceDir}/testinput
if [ ! -f "${__resourceDir}/input" ]; then
curl -s \ curl -s \
-A "https://git.yetaga.in/alazyreader/AdventOfCode${__year}/" \ -A "https://git.yetaga.in/alazyreader/AdventOfCode${__year}/" \
-H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${__day##0}/input > "src/resources/inputs/${padded}/input" -H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${__day##0}/input > "${__resourceDir}/input"
fi fi
if [ ! -f "src/Day${padded}.java" ]; then if [ ! -f "src/Day${padded}.java" ]; then
cp main.java.tmpl src/Day${padded}.java cp main.java.tmpl src/Day${padded}.java