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