#!/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 $ghcup run "${versionargs[@]}" -- ghci Yahb2Defs.hs 2>&1 # vim: set sw=2 ts=8 et: