mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 02:42:59 +00:00
notation: add shell completions
This commit is contained in:
parent
36888d20c9
commit
dbea610adb
@ -1,4 +1,4 @@
|
||||
{ lib, buildGoModule, fetchFromGitHub, testers, notation }:
|
||||
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, notation }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "notation";
|
||||
@ -13,6 +13,10 @@ buildGoModule rec {
|
||||
|
||||
vendorHash = "sha256-USkufc1dG4eyRfRJHSX4mVZHnvOc5onHenF98Aedac4=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
# This is a Go sub-module and cannot be built directly (e2e tests).
|
||||
excludedPackages = [ "./test" ];
|
||||
|
||||
@ -23,6 +27,13 @@ buildGoModule rec {
|
||||
"-X github.com/notaryproject/notation/internal/version.BuildMetadata="
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd notation \
|
||||
--bash <($out/bin/notation completion bash) \
|
||||
--fish <($out/bin/notation completion fish) \
|
||||
--zsh <($out/bin/notation completion zsh)
|
||||
'';
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
package = notation;
|
||||
command = "notation version";
|
||||
|
Loading…
Reference in New Issue
Block a user