#!/bin/bash set -euo pipefail cd "$(dirname "$0")" ver=$(ghcup --offline list -t ghc -c installed -r 2>/dev/null | sed -n '/latest/ s/^ghc \([^ ]*\).*/\1/p') if [[ -n $ver ]]; then versionargs=( --ghc "$ver" ) # if we can get "latest", take that else versionargs=() # just fall back to the currently "set" version fi ghcup --offline run "${versionargs[@]}" -- ghci Yahb2Defs.hs 2>&1 # vim: set sw=2 ts=8 et: