···1717[no-cd]
1818do part input:
1919 #!/usr/bin/env fish
2020- if test -f {{part}}.hs
2020+ set fn (fd -d 1 -t f {{part}})
2121+ if test -n "$fn" -a -x "$fn"
2222+ time ./$fn < {{input}}
2323+ else if test -f {{part}}.pl
2424+ and time swipl -s "$fn" -g main,halt < {{input}}
2525+ else if test -f {{part}}.hs
2126 ghc {{part}} -O -outputdir.{{part}} > /dev/null
2227 and time ./{{part}} < {{input}}
2328 else if ls | rg "\.cabal\$" -q
2429 cabal build {{part}} > /dev/null
2530 and time cabal run {{part}} < {{input}}
2626- else if test -f {{part}}.fish
2727- time ./{{part}}.fish < {{input}}
2831 else
2932 echo "Current directory does not contain known solution configuration"
3033 exit 1