Skip to content

Commit 439459c

Browse files
Improve script.sh
1 parent fb46cc6 commit 439459c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
cookie.txt
12
input.txt
2-
target/
3+
target/

scripts.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# based on script.sh from HyperNeutrino:
22
# https://github.com/hyper-neutrino/advent-of-code/blob/main/scripts.sh
33

4-
export AOC_COOKIE="..." # get this from the cookies tab in network tools on the AOC website
4+
export AOC_COOKIE=$(cat $(dirname $0)/cookie.txt) # get this from the cookies tab in network tools on the AOC website
55

66
function aoc-load () {
77
if [ $1 ]
@@ -10,4 +10,5 @@ function aoc-load () {
1010
else
1111
curl --cookie "session=$AOC_COOKIE" "$(echo `date +https://adventofcode.com/%Y/day/%d/input` | sed 's/\/0/\//g')" > input.txt
1212
fi
13+
cat input.txt
1314
}

0 commit comments

Comments
 (0)