make the today script nicer
This commit is contained in:
9
today.sh
9
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
|
||||
|
||||
Reference in New Issue
Block a user