scaffold
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.cookie
|
||||||
|
*/inputs
|
||||||
17
run.sh
Executable file
17
run.sh
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
__year=2024
|
||||||
|
|
||||||
|
__day="${1}"
|
||||||
|
if [ -z "${__day}" ]; then
|
||||||
|
__day=$(date '+%d')
|
||||||
|
fi
|
||||||
|
|
||||||
|
padded=$(printf "%02g" ${__day})
|
||||||
|
if [ -f "${padded}/index.ts" ]; then
|
||||||
|
cd $padded
|
||||||
|
npx tsx "index.ts" 2>/dev/null
|
||||||
|
cd - >/dev/null
|
||||||
|
else
|
||||||
|
echo "day not found"
|
||||||
|
fi
|
||||||
21
today.sh
Executable file
21
today.sh
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
__year=2024
|
||||||
|
|
||||||
|
__day="${1}"
|
||||||
|
if [ "${__day}" == "" ]; then
|
||||||
|
__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
|
||||||
|
if [ ! -f "${padded}/index.ts" ]; then
|
||||||
|
cp index.ts.tmpl ${padded}/index.ts
|
||||||
|
fi
|
||||||
|
open "https://adventofcode.com/${__year}/day/${__day##0}"
|
||||||
Reference in New Issue
Block a user