mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-11-06 10:16:44 +01:00
Merge pull request #143656 from figsoda/dyff-version
dyff: fix version output, install shell completions
This commit is contained in:
commit
0e3f614a90
|
@ -1,4 +1,4 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub}:
|
||||
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "dyff";
|
||||
|
@ -19,6 +19,27 @@ buildGoModule rec {
|
|||
"internal/cmd"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
# test fails with the injected version
|
||||
postPatch = ''
|
||||
substituteInPlace internal/cmd/cmds_test.go \
|
||||
--replace "version (development)" ${version}
|
||||
'';
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X=github.com/homeport/dyff/internal/cmd.version=${version}"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd dyff \
|
||||
--bash <($out/bin/dyff completion bash) \
|
||||
--fish <($out/bin/dyff completion fish) \
|
||||
--zsh <($out/bin/dyff completion zsh)
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A diff tool for YAML files, and sometimes JSON";
|
||||
longDescription = ''
|
||||
|
|
Loading…
Reference in a new issue