diff options
author | Florian Klink <flokli@flokli.de> | 2023-10-17T20·00+0100 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2023-10-17T20·25+0000 |
commit | 45d8a78a8b39561622fafdc495edf2dbac49465d (patch) | |
tree | c9bea8fdd02df4d7525cb91cb6853333769d5b7c /tvix/store-go/default.nix | |
parent | c4ea2053877f3560b349b6f339f78baca4b06290 (diff) |
chore(tvix): move regenerate scripts to passthru r/6846
This keeps things isolated a bit more. Change-Id: I437f2f63ee1567c0cbc02298514ad4d89f1dce85 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9790 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store-go/default.nix')
-rw-r--r-- | tvix/store-go/default.nix | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tvix/store-go/default.nix b/tvix/store-go/default.nix index b559594a27f2..eb814d1e3ae9 100644 --- a/tvix/store-go/default.nix +++ b/tvix/store-go/default.nix @@ -1,5 +1,10 @@ { depot, pkgs, ... }: +let + regenerate = pkgs.writeShellScriptBin "regenerate" '' + (cd $(git rev-parse --show-toplevel)/tvix/store-go && rm *.pb.go && cp ${depot.tvix.store.protos.go-bindings}/*.pb.go . && chmod +w *.pb.go) + ''; +in (pkgs.buildGoModule { name = "store-go"; src = depot.third_party.gitignoreSource ./.; @@ -10,10 +15,10 @@ label = ":water_buffalo: ensure generated protobuf files match"; needsOutput = true; command = pkgs.writeShellScript "pb-go-check" '' - ${depot.tvix.store-go-generate} + ${regenerate} if [[ -n "$(git status --porcelain -unormal)" ]]; then echo "-----------------------------" - echo ".pb.go files need to be updated, run //tvix:store-go-generate" + echo ".pb.go files need to be updated, mg run //tvix/store-go/generate" echo "-----------------------------" git status -unormal exit 1 @@ -22,4 +27,5 @@ alwaysRun = true; }; }; + passthru.regenerate = regenerate; }) |