buildGoModule: prefer verbose output when NIX_DEBUG set

> The -v flag causes vendor to print the names of vendored modules and packages
> to standard error.

The `-v` flag helped me debug a `buildGoModule` derivation yesterday evening.
This commit is contained in:
William Carroll 2022-05-25 10:06:11 -07:00 committed by zowoq
parent d0617b0846
commit 06e270fd51

View file

@ -106,7 +106,10 @@ let
mkdir -p "''${GOPATH}/pkg/mod/cache/download"
go mod download
'' else ''
go mod vendor
if (( "''${NIX_DEBUG:-0}" >= 1 )); then
goModVendorFlags+=(-v)
fi
go mod vendor "''${goModVendorFlags[@]}"
''}
mkdir -p vendor