3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #133905 from raboof/buf-use-testVersion-utility

buf: use testVersion utility
This commit is contained in:
Sandro 2021-08-18 11:59:49 +02:00 committed by GitHub
commit 3f3e055bcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View file

@ -613,7 +613,7 @@ rec {
command ? "${package.meta.mainProgram or package.pname or package.name} --version",
version ? package.version,
}: runCommand "test-version" { nativeBuildInputs = [ package ]; meta.timeout = 60; } ''
${command} | grep -Fw ${version}
${command} |& grep -Fw ${version}
touch $out
'';
}

View file

@ -3,6 +3,8 @@
, fetchFromGitHub
, protobuf
, git
, testVersion
, buf
}:
buildGoModule rec {
@ -54,13 +56,7 @@ buildGoModule rec {
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/buf --help
$out/bin/buf --version 2>&1 | grep "${version}"
runHook postInstallCheck
'';
passthru.tests.version = testVersion { package = buf; };
meta = with lib; {
homepage = "https://buf.build";