From 81d288abb85f53c7852a0ab8d0c690786b7807c4 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Wed, 1 Dec 2021 13:41:00 +0200 Subject: Add run script --- aoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 aoc (limited to 'aoc') diff --git a/aoc b/aoc new file mode 100755 index 0000000..8e144fb --- /dev/null +++ b/aoc @@ -0,0 +1,17 @@ +#!/bin/bash + +DAY="${1}" +if [ -z "${DAY}" ]; then + echo "usage: ${0} day01" + exit 1 +fi + +set -euo pipefail + +cd "${DAY}" +if [ ! -f "input.txt" ]; then + echo "input.txt not found in ${DAY}" + exit 1 +fi + +ghc ../utils.hs main.hs && (cat input.txt | ./main) -- cgit v1.3