From fa811780b391c3687ce1cf477515cb82b5bd345d Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 2 Dec 2021 10:45:26 +0200 Subject: Day 02 --- aoc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'aoc') 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) -- cgit v1.3