Merge pull request #168286 from liff/dsq/add-version-on-build

dsq: pass version to the build
This commit is contained in:
Guillaume Girol 2022-04-16 13:21:18 +00:00 committed by GitHub
commit 2073659a0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@
, runCommand
, nix-update-script
, dsq
, testVersion
, diffutils
}:
@ -23,10 +24,14 @@ buildGoModule rec {
nativeBuildInputs = [ diffutils ];
ldflags = [ "-X" "main.Version=${version}" ];
passthru = {
updateScript = nix-update-script { attrPath = pname; };
tests = {
version = testVersion { package = dsq; };
pretty-csv = runCommand "${pname}-test" { } ''
mkdir "$out"
cat <<EOF > "$out/input.csv"