From 01bda0f0aa87c34a30253ffd1d5b60b33644f6d8 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 25 Jul 2020 22:24:44 -0700 Subject: bild: support incremental compilation Closes https://github.com/bsima/biz/issues/9 --- nix/shellHook.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'nix/shellHook.sh') diff --git a/nix/shellHook.sh b/nix/shellHook.sh index 035c450..981f86e 100644 --- a/nix/shellHook.sh +++ b/nix/shellHook.sh @@ -20,20 +20,27 @@ function deps() { niv --sources-file $BIZ_ROOT/nix/sources.json $@ } -function ghci() { - ghci -i$BIZ_ROOT -ghci-script "$BIZ_ROOT/.ghci" -} +alias ghci="ghci -i$BIZ_ROOT -ghci-script $BIZ_ROOT/.ghci" function hero() { - out="_bild/nix" export HERO_PORT=3000 - export HERO_NODE=$BIZ_ROOT/$out/Hero.Node/static export HERO_KEEP=$BIZ_ROOT/_keep export HERO_SKEY=$BIZ_ROOT/_skey - b="runghc Biz.Bild" - rg --files \ - | entr -rcs \ - "$b Hero.Host && $b Hero.Node && $out/Hero.Host/bin/mmc" + bild="runghc Biz.Bild" + if [[ -z "${IN_NIX_SHELL}" ]] + then + out="_bild/dev" + export HERO_NODE=$BIZ_ROOT/$out/static/mmc.js/all.js + rg --files \ + | entr -rcs \ + "$bild Hero.Host && $bild Hero.Node && $out/bin/mmc" + else + out="_bild/nix" + export HERO_NODE=$BIZ_ROOT/$out/Hero.Node/static + rg --files \ + | entr -rcs \ + "$bild Hero.Host && $bild Hero.Node && $out/Hero.Host/bin/mmc" + fi } function lint() { -- cgit v1.2.3