diff options
author | Ben Sima <ben@bsima.me> | 2020-07-25 22:24:44 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-07-25 23:25:05 -0700 |
commit | 01bda0f0aa87c34a30253ffd1d5b60b33644f6d8 (patch) | |
tree | 8d2ac795680b8379c44bfe7f4817753482b3b961 /nix/shellHook.sh | |
parent | 2f32da5812583c6675bdc9ff88a3a3d5cefbb82f (diff) |
bild: support incremental compilation
Closes https://github.com/bsima/biz/issues/9
Diffstat (limited to 'nix/shellHook.sh')
-rw-r--r-- | nix/shellHook.sh | 25 |
1 files changed, 16 insertions, 9 deletions
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() { |