aboutsummaryrefslogtreecommitdiffstats
path: root/aoc
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2021-12-02 10:45:26 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2021-12-02 10:45:26 +0200
commitfa811780b391c3687ce1cf477515cb82b5bd345d (patch)
tree3b9479d1ac6cdc778c88e50ca2b15aabb54be0dc /aoc
parent2b1b80f1a16da78350c57ac9cbbf67ba21856f79 (diff)
Day 02
Diffstat (limited to 'aoc')
-rwxr-xr-xaoc8
1 files changed, 5 insertions, 3 deletions
diff --git a/aoc b/aoc
index 8e144fb..e04ddf6 100755
--- a/aoc
+++ b/aoc
@@ -1,6 +1,8 @@
#!/bin/bash
DAY="${1}"
+INPUT="${2:-input.txt}"
+
if [ -z "${DAY}" ]; then
echo "usage: ${0} day01"
exit 1
@@ -9,9 +11,9 @@ fi
set -euo pipefail
cd "${DAY}"
-if [ ! -f "input.txt" ]; then
- echo "input.txt not found in ${DAY}"
+if [ ! -f "${INPUT}" ]; then
+ echo "${INPUT} not found in ${DAY}"
exit 1
fi
-ghc ../utils.hs main.hs && (cat input.txt | ./main)
+ghc ../utils.hs main.hs && (cat "${INPUT}" | ./main)