feat(depot-build): Add a tool to build at arbitrary tree locations
Assuming you're in `/depot/fun/clbot`, you can do this:
tazjin@frog /d/f/clbot (master)> depot-build
Building //fun/clbot
/nix/store/i1zc6g58wa4819kyhaqi12zsh3hr31ph-clbot
It is automatically added to the $PATH using direnv, too.
Change-Id: Ia3341704e6317c2b8de40a3fa1be3b680d21a42d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/388
Reviewed-by: eta <eta@theta.eu.org>
This commit is contained in:
parent
c26ee5a448
commit
29bab159ab
3 changed files with 12 additions and 0 deletions
8
tools/depot-build.nix
Normal file
8
tools/depot-build.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Utility script for building any arbitrary depot path in its folder.
|
||||
{ pkgs, ... }:
|
||||
|
||||
pkgs.writeShellScriptBin "depot-build" ''
|
||||
TARGET=$(git rev-parse --show-prefix | sed 's|/$||')
|
||||
echo "Building //$TARGET"
|
||||
nix-build -A $(echo $TARGET | sed 's|/|.|') $(${pkgs.git}/bin/git rev-parse --show-toplevel)
|
||||
''
|
||||
Loading…
Add table
Add a link
Reference in a new issue