dasel: add shell completions to output

This commit is contained in:
Gabriel Arazas 2023-07-02 23:14:44 +08:00
parent 99d4bf7bab
commit 73d24f8aac

View file

@ -1,6 +1,7 @@
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
@ -20,6 +21,15 @@ buildGoModule rec {
"-s" "-w" "-X github.com/tomwright/dasel/v2/internal.Version=${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd dasel \
--bash <($out/bin/dasel completion bash) \
--fish <($out/bin/dasel completion fish) \
--zsh <($out/bin/dasel completion zsh)
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck