21 lines
421 B
Plaintext
21 lines
421 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
year=2020
|
||
|
day="$(date +%d | sed 's/^0//')"
|
||
|
case $# in
|
||
|
2)
|
||
|
year=$2
|
||
|
day=$1
|
||
|
specifyyear=_$year;;
|
||
|
1)
|
||
|
day=$1
|
||
|
esac
|
||
|
|
||
|
file=input$day$specifyyear
|
||
|
|
||
|
#cd ~/repos/aoc/twenty/
|
||
|
curl -s -o $file -H "Cookie: session=$(cat cookie)" \
|
||
|
https://adventofcode.com/$year/day/$day/input
|
||
|
|
||
|
git add $file
|
||
|
git commit -m "input day $day $year" $file >/dev/null # cron appreciates silence
|