2024-11-03 19:29:28 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
__year=2024
|
|
|
|
|
|
|
|
__day="${1}"
|
2024-12-01 19:52:48 +00:00
|
|
|
if [ "${__day}" == "" ]; then
|
2024-11-03 19:29:28 +00:00
|
|
|
__day=$(date '+%d')
|
|
|
|
fi
|
|
|
|
|
|
|
|
padded=$(printf "%02g" ${__day})
|
|
|
|
mkdir -p ${padded}/inputs
|
|
|
|
touch ${padded}/inputs/testinput
|
|
|
|
if [ ! -f "${padded}/inputs/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 > "${padded}/inputs/input"
|
|
|
|
fi
|
2024-12-04 02:42:55 +00:00
|
|
|
if [ ! -f "${padded}/index.ts" ]; then
|
2024-12-05 03:18:24 +00:00
|
|
|
cp index.ts.tmpl ${padded}/index.ts
|
2024-12-04 02:42:55 +00:00
|
|
|
fi
|
2024-12-01 19:52:48 +00:00
|
|
|
open "https://adventofcode.com/${__year}/day/${__day##0}"
|