summaryrefslogtreecommitdiff
path: root/Biz/Bild/ShellHook.sh
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-12-30 12:24:47 -0500
committerBen Sima <ben@bsima.me>2020-12-30 12:50:09 -0500
commit9da4feb106126940264dd27925ea3c19b04aac20 (patch)
tree23a8fe41eb6ef7ef51280e598bebfbf54f851ebc /Biz/Bild/ShellHook.sh
parentf0895bfd73c53d9d5d9811c632d8e6f5e99dc0d4 (diff)
bild: build everyting
Now bild knows how to determine between modules that require ghcjs and ghc. It also knows what *not* to build, meaning it won't try to build non-buildable nix targets, for example (unfortunately this is just hardcoded for now), but it also won't build scm or py targets that I haven't implemented yet. It just silently fails, which is fine, because it means I can do `bild **/*` and everything just works. Of course, if I want to build scm code then I will have to implement that, but that's not a priority right now.
Diffstat (limited to 'Biz/Bild/ShellHook.sh')
-rw-r--r--Biz/Bild/ShellHook.sh67
1 files changed, 13 insertions, 54 deletions
diff --git a/Biz/Bild/ShellHook.sh b/Biz/Bild/ShellHook.sh
index e83973e..e307e04 100644
--- a/Biz/Bild/ShellHook.sh
+++ b/Biz/Bild/ShellHook.sh
@@ -7,7 +7,6 @@ function help() {
echo " deps manage dependencies with niv"
echo " ghci start ghci with correct options"
echo " help show this message"
- echo " hero compile and start a dev server for herocomics.app"
echo " lint auto-lint all changed files"
echo " pie product improvement engine"
echo " push send a namespace to the cloud"
@@ -34,28 +33,6 @@ function deps() {
alias ghci="ghci -i$BIZ_ROOT -ghci-script $BIZ_ROOT/.ghci"
-function hero() {
- export HERO_PORT=3000
- export HERO_KEEP=$BIZ_ROOT/_/keep
- export HERO_SKEY=$BIZ_ROOT/_/skey
- bild="runghc Biz.Bild"
- if [[ ! -z "${IN_NIX_SHELL}" ]]
- then
- out="_/bild/dev"
- # in dev mode, mmc.js is a directory of js assets
- export HERO_NODE=$BIZ_ROOT/$out/static/mmc.js
- rg --files \
- | entr -rcs \
- "$bild Hero.Host.hs && $bild Hero.Node.hs && $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
-}
-
alias lint=$BIZ_ROOT/Biz/Lint.py
function pie() {
@@ -73,6 +50,7 @@ function push() {
else
target="$prefix.$1"
fi
+ echo "push: $target"
what=$(realpath "$BIZ_ROOT/_/bild/nix/$target")
# hack: get the domain from the activation script. there does not seem
# to be a way to get it from nix-instantiate
@@ -84,21 +62,18 @@ function push() {
# TODO: convert to haskell
function ship() {
- $BIZ_ROOT/Biz/Lint.py
- stuff=(${1})
+ lint
+ stuff=(${@})
if [[ ${#stuff[@]} -eq 0 ]]
then
stuff=(
- Biz.Cloud
- Biz.Dev
- Que.Prod
- Hero.Prod
+ Biz/Cloud.nix
+ Biz/Dev.nix
+ Biz/Que/Prod.nix
+ Hero/Prod.nix
)
fi
- for thing in ${stuff[@]}
- do
- bild $thing
- done
+ bild ${stuff[@]}
for thing in ${stuff[@]}
do
push $thing
@@ -106,27 +81,11 @@ function ship() {
}
# Poor man's ci
-function ci() {
- set -e
- lint **/*
- stuff=(
- Biz/Pie.hs
- Biz/Pie.nix
- Biz/Devalloc.hs
- Biz/Que/Site.hs
- Biz/Que/Host.hs
- Biz/Que/Prod.nix
- Biz/Cloud.nix
- Biz/Dev.nix
- Hero/Host.hs
- Hero/Node.hs
- Hero/Prod.nix
- )
- for thing in ${stuff[@]}
- do
- bild "$thing"
- done
- set +e
+function run-ci() {
+ lint **/* && bild **/*
}
+alias ci="time run-ci"
+
+export PS1='\n$(printf "%3.*s" $? $?)> '
help