summaryrefslogtreecommitdiff
path: root/bild
diff options
context:
space:
mode:
Diffstat (limited to 'bild')
-rwxr-xr-xbild13
1 files changed, 8 insertions, 5 deletions
diff --git a/bild b/bild
index 5b74ffb..8ea07ea 100755
--- a/bild
+++ b/bild
@@ -1,8 +1,11 @@
#!/usr/bin/env bash
-nix build -o "_bild/$@" -f default.nix "$@"
-if [[ $? != 0 ]]
+set -ex
+prefix=$(echo $PWD | sed -e "s|^$BIZ_ROOT/*||g" -e "s|/|.|g")
+if [[ "$prefix" == "" ]]
then
- echo ":: bild fail"
- echo ":: replaying the log..."
- PAGER=cat nix log -f default.nix "$@"
+ target="$1"
+else
+ target="$prefix.$1"
fi
+nix build -o "$BIZ_ROOT/_bild/$target" \
+ -f $BIZ_ROOT/default.nix "$target" --show-trace