diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2021-12-01 13:41:00 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2021-12-01 13:41:00 +0200 |
| commit | 81d288abb85f53c7852a0ab8d0c690786b7807c4 (patch) | |
| tree | 5133a8114a3413f8ba79f3a08d8384ecdc79eea9 | |
| parent | 8c01338d1ce04103308628fad0038a890c2803fe (diff) | |
Add run script
| -rw-r--r-- | README.md | 3 | ||||
| -rwxr-xr-x | aoc | 17 |
2 files changed, 18 insertions, 2 deletions
@@ -4,8 +4,7 @@ Language: Haskell ## Running exercises - cd day01 - ghc ../utils.hs main.hs && (cat input.txt | ./main) + ./aoc day01 ## Author @@ -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) |
