advent2020/gettoday

21 lines
421 B
Plaintext
Raw Permalink Normal View History

2021-11-11 10:21:11 +02:00
#!/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