summaryrefslogtreecommitdiff
path: root/bin/fetch_input.sh
diff options
context:
space:
mode:
authorcos <cos>2021-12-07 13:44:07 +0100
committercos <cos>2021-12-07 14:06:16 +0100
commit05d995d3c25b012f652654d02715256a3a97c0fd (patch)
treef86b245fd21059c48ed32d073d54c31b41a2a0a8 /bin/fetch_input.sh
parent9dfb22a9eb14d7884b534f2ae34c4807424fe19e (diff)
downloadadventofcode-05d995d3c25b012f652654d02715256a3a97c0fd.zip
Add example.txt creation for simple inputs
Diffstat (limited to 'bin/fetch_input.sh')
-rwxr-xr-xbin/fetch_input.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/fetch_input.sh b/bin/fetch_input.sh
index d3a96ec..ec09328 100755
--- a/bin/fetch_input.sh
+++ b/bin/fetch_input.sh
@@ -66,6 +66,7 @@ if [ "${MODE}" = 'wget' ]; then
authenticated_wget --output-document "input/${USERNAME}" \
"https://adventofcode.com/${YEAR}/day/${DEC}/input"
elinks -dump "./input/page_${DEC}.html" >"input/page_${DEC}.txt"
+ sed -n 's/^ \([^ ]\)/\1/p' <"input/page_${DEC}.txt" >"input/example.txt"
fi
elif [ "${MODE}" = 'aocdl' ]; then
# One could possibly use the golang implemenation instead of wget: