blob: 836bed9f1b57d655e1b45ca585d1b08c25873999 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/usr/bin/env bash
#
# a simple complement to bild which only deals with launching repls
#
# > repl <target>
#
# Starts a repl/shell for target.
#
# - if target.hs, load ghci
# - TODO: if target.scm, load scheme repl
# - TODO: if target.nix, load 'nix repl'
##
set -e
target=${1:?}
json=$(bild --json "$target")
langdeps=$(jq --raw-output '.[].langdeps | join(" ")' <<< $json)
case $target in
*.hs)
nix-shell \
--packages "(import $BIZ_ROOT/Biz/Bild.nix {}).ghcWith (h: with h; [$langdeps])" \
--command "ghci -i$BIZ_ROOT -ghci-script $BIZ_ROOT/.ghci $target"
;;
*.scm)
echo "scheme repl not supported yet: $target"
exit 1
;;
*.lisp)
swank-lisp-launcher.sh \
--eval "(asdf:load-system 'swank)" \
--eval "(swank:create-server :dont-close t)"
;;
*)
echo "unsupported target: $target"
exit 1
;;
esac
##
|