2023-11-30 21:41:08 +01:00
|
|
|
#!/bin/sh
|
|
|
|
day="$(printf '%02d' ${1##0})"
|
|
|
|
part="$2"
|
2023-12-03 12:35:24 +01:00
|
|
|
inputfile="$3"
|
2023-11-30 21:41:08 +01:00
|
|
|
|
2023-12-03 12:35:24 +01:00
|
|
|
case "$inputfile" in
|
|
|
|
"") inputfile="$PWD/francis-punt/${day}_input.txt";;
|
|
|
|
/*) ;;
|
|
|
|
*) inputfile="$PWD/$inputfile";;
|
|
|
|
esac
|
2023-11-30 21:41:08 +01:00
|
|
|
|
|
|
|
if ! test -f "$inputfile"; then
|
|
|
|
echo "no input available" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
for dir in *; do
|
|
|
|
if test -d "$dir"; then
|
|
|
|
cd "$dir"
|
|
|
|
if test -x ./prepare; then
|
|
|
|
echo "---------------------------------------------------------------------------------- $dir"
|
2023-12-03 12:35:24 +01:00
|
|
|
if ! ./prepare "$day" "$part" "$inputfile" >&2; then
|
2023-11-30 21:41:08 +01:00
|
|
|
echo 'eh ge hebt precies niet alles geïnstalleerd staan'
|
|
|
|
else
|
|
|
|
if test -x run; then
|
|
|
|
hyperfine -n "$dir" "./run '$day' '$part' '$inputfile'"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test -x ./clean; then
|
|
|
|
./clean "$day" "$part" "$inputfile"
|
|
|
|
fi
|
|
|
|
cd - > /dev/null 2>&1
|
|
|
|
fi
|
|
|
|
done
|