diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2021-12-02 10:45:26 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2021-12-02 10:45:26 +0200 |
| commit | fa811780b391c3687ce1cf477515cb82b5bd345d (patch) | |
| tree | 3b9479d1ac6cdc778c88e50ca2b15aabb54be0dc /aoc | |
| parent | 2b1b80f1a16da78350c57ac9cbbf67ba21856f79 (diff) | |
Day 02
Diffstat (limited to 'aoc')
| -rwxr-xr-x | aoc | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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) |
