summaryrefslogtreecommitdiff
path: root/Biz
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2022-06-29 11:37:29 -0400
committerBen Sima <ben@bsima.me>2022-07-05 19:03:07 -0400
commita827b9eb6ad80cb0de5e824ff5624a436fc01e81 (patch)
treecb4253bd6679e1aaec8d934c54ebd53f8b6a69d5 /Biz
parentab2b9e4e3e9a433f75761314e54750f014c13b83 (diff)
Case on target extension and provide proper error messages
Diffstat (limited to 'Biz')
-rwxr-xr-xBiz/Ide/repl18
1 files changed, 15 insertions, 3 deletions
diff --git a/Biz/Ide/repl b/Biz/Ide/repl
index 3b24144..3fc8a08 100755
--- a/Biz/Ide/repl
+++ b/Biz/Ide/repl
@@ -14,7 +14,19 @@
target=${1:?}
json=$(bild --json "$target")
langdeps=$(jq --raw-output '.[].langdeps | join(" ")' <<< $json)
- 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"
+ 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
+ ;;
+ *)
+ echo "unsupported target: $target"
+ exit 1
+ ;;
+ esac
##