Merge pull request #168703 from Artturin/testversion1

This commit is contained in:
Artturi
2022-04-17 22:40:45 +03:00
committed by GitHub
+6 -2
View File
@@ -814,7 +814,11 @@ rec {
command ? "${package.meta.mainProgram or package.pname or package.name} --version",
version ? package.version,
}: runCommand "${package.name}-test-version" { nativeBuildInputs = [ package ]; meta.timeout = 60; } ''
${command} |& grep -Fw ${version}
touch $out
if output=$(${command} 2>&1); then
grep -Fw "${version}" - <<< "$output"
touch $out
else
echo "$output" >&2 && exit 1
fi
'';
}