From 4f6d8e5525f4b6bb21890ac974638295cafbd219 Mon Sep 17 00:00:00 2001 From: David Ashby Date: Mon, 1 Dec 2025 20:47:58 -0500 Subject: [PATCH] make the today script nicer --- today.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/today.sh b/today.sh index fea9b34..dd093a7 100755 --- a/today.sh +++ b/today.sh @@ -8,12 +8,13 @@ if [ "${__day}" == "" ]; then fi padded=$(printf "%02g" ${__day}) -mkdir -p src/resources/inputs/${padded} -touch src/resources/inputs/${padded}/testinput -if [ ! -f "src/resources/inputs/${padded}/input" ]; then +__resourceDir=src/resources/inputs/${padded} +mkdir -p ${__resourceDir} +touch ${__resourceDir}/testinput +if [ ! -f "${__resourceDir}/input" ]; then curl -s \ -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 if [ ! -f "src/Day${padded}.java" ]; then cp main.java.tmpl src/Day${padded}.java