aboutsummaryrefslogtreecommitdiff
path: root/bwrap-files/workdir/entry.sh
blob: 436ba64f82eb69b47292d737293ae07ba8605930 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
set -euo pipefail

cd "$(dirname "$0")"

ghcup='ghcup --no-verbose --offline'

# Just take the latest version that ghcup prints, assuming that that's the latest installed one
ver=$($ghcup list -t ghc -c installed -r 2>/dev/null | sed -n '$ s/^ghc \([^ ]*\).*/\1/p')
if [[ -n $ver ]]; then
  versionargs=( --ghc "$ver" )
else
  # If that fails for whatever reason, just fall back to the currently "set" version
  versionargs=()
fi

# Inform yahb2 about the GHC version we're using
echo "yahb2-ghci-version=$($ghcup run "${versionargs[@]}" -- ghci --numeric-version)"

$ghcup run "${versionargs[@]}" -- ghci Yahb2Defs.hs 2>&1

# vim: set sw=2 ts=8 et: