2019-10-30 22:18:43 +03:00
#!/bin/bash
2019-10-30 23:08:42 +03:00
# Usage: script/repl [ARGS...]
# Run a repl session capable of loading all of the packages and their individual components. Any passed arguments, e.g. module names or flags, will be passed to ghci.
2019-10-30 22:18:43 +03:00
set -e
cd $(dirname "$0")/..
2019-10-30 23:34:16 +03:00
repl_builddir=dist-repl
if [[ ! -d $repl_builddir ]]; then
2019-11-01 16:10:49 +03:00
echo "$repl_builddir does not exist, first run 'cabal repl --builddir=$repl_builddir', exit, and then re-run $0"
2019-10-30 23:34:16 +03:00
else
2019-11-01 18:59:30 +03:00
cabal exec --builddir=$repl_builddir ghci -- -ghci-script=.ghci.semantic $(script/ghci-flags --builddir "$repl_builddir") -no-ignore-dot-ghci $@
2019-10-30 23:34:16 +03:00
fi