day 1 in the books
This commit is contained in:
10
today.sh
10
today.sh
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
__year=2024
|
||||
__year=2025
|
||||
|
||||
__day="${1}"
|
||||
if [ "${__day}" == "" ]; then
|
||||
@@ -8,15 +8,15 @@ if [ "${__day}" == "" ]; then
|
||||
fi
|
||||
|
||||
padded=$(printf "%02g" ${__day})
|
||||
mkdir -p ${padded}/inputs
|
||||
touch ${padded}/inputs/testinput
|
||||
if [ ! -f "${padded}/inputs/input" ]; then
|
||||
mkdir -p src/resources/inputs/${padded}
|
||||
touch src/resources/inputs/${padded}/testinput
|
||||
if [ ! -f "src/resources/inputs/${padded}/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"
|
||||
fi
|
||||
if [ ! -f "src/Day${padded}.java" ]; then
|
||||
cp main.java.tmpl src/Day${padded}.java
|
||||
gsed -i '' "s/00/${padded}/g" src/Day${padded}.java
|
||||
sed -i '' "s/00/${padded}/g" src/Day${padded}.java
|
||||
fi
|
||||
open "https://adventofcode.com/${__year}/day/${__day##0}"
|
||||
|
||||
Reference in New Issue
Block a user