38 lines
647 B
Bash
Executable File
38 lines
647 B
Bash
Executable File
#! /bin/sh
|
|
set -e
|
|
|
|
if [ "$#" -ne 1 ]; then
|
|
echo "Parameter expected: <day>"
|
|
exit 1
|
|
fi
|
|
|
|
|
|
if [ "$1" == "--help" ]; then
|
|
echo "Usage: $0 <dayxx>"
|
|
exit 1
|
|
fi
|
|
|
|
if ! [ -d "$1" ]; then
|
|
echo "Not a directory: $1"
|
|
exit 1
|
|
fi
|
|
|
|
cd "$1"
|
|
|
|
case "$1" in
|
|
# Solutions -- Haskell
|
|
"day01a" | "day01b" | \
|
|
"day02a" | "day02b" | \
|
|
"day03a" | "day03b" | \
|
|
"day04a" | "day04b" | \
|
|
"day06a" | "day06b" | \
|
|
"day07a" | "day07b" | \
|
|
"day08a" | "day08b" | \
|
|
"day09a" | "day09b" | \
|
|
"day10a" | "day10b") stack run <input.txt
|
|
;;
|
|
# Default solutions -- Java
|
|
*) ./gradlew run <input.txt
|
|
;;
|
|
esac
|