From a827b9eb6ad80cb0de5e824ff5624a436fc01e81 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 29 Jun 2022 11:37:29 -0400 Subject: Case on target extension and provide proper error messages --- Biz/Ide/repl | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'Biz') 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 ## -- cgit v1.2.3