Merge pull request #168286 from liff/dsq/add-version-on-build
dsq: pass version to the build
This commit is contained in:
commit
2073659a0f
|
@ -5,6 +5,7 @@
|
||||||
, runCommand
|
, runCommand
|
||||||
, nix-update-script
|
, nix-update-script
|
||||||
, dsq
|
, dsq
|
||||||
|
, testVersion
|
||||||
, diffutils
|
, diffutils
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -23,10 +24,14 @@ buildGoModule rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ diffutils ];
|
nativeBuildInputs = [ diffutils ];
|
||||||
|
|
||||||
|
ldflags = [ "-X" "main.Version=${version}" ];
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
updateScript = nix-update-script { attrPath = pname; };
|
updateScript = nix-update-script { attrPath = pname; };
|
||||||
|
|
||||||
tests = {
|
tests = {
|
||||||
|
version = testVersion { package = dsq; };
|
||||||
|
|
||||||
pretty-csv = runCommand "${pname}-test" { } ''
|
pretty-csv = runCommand "${pname}-test" { } ''
|
||||||
mkdir "$out"
|
mkdir "$out"
|
||||||
cat <<EOF > "$out/input.csv"
|
cat <<EOF > "$out/input.csv"
|
||||||
|
|
Loading…
Reference in a new issue