adventofcode-2021/prepare

15 lines
312 B
Plaintext
Raw Normal View History

2021-11-29 11:34:50 +01:00
#!/bin/sh
day="$1"
part="$2"
2021-12-09 09:59:55 +01:00
day="$(printf '%02d' "${day##0}")"
2021-11-29 11:34:50 +01:00
2021-12-03 09:41:12 +01:00
if test -f "day${day}/part${part}.lua"; then
2021-12-05 12:17:39 +01:00
/usr/bin/env luajit -v >/dev/null
cp "day${day}/part${part}.lua" run
2021-12-06 22:02:21 +01:00
chmod u+x run
2021-12-03 09:41:12 +01:00
elif test -f "day${day}/part${part}.hs"; then
2021-11-29 11:34:50 +01:00
#stack build
2021-12-03 09:41:12 +01:00
stack ghc -- -O3 "day${day}/part${part}.hs" -o run
2021-11-29 11:34:50 +01:00
fi