trivy: add shell completions
This commit is contained in:
parent
c757e9bd77
commit
b297cddb05
@ -1,6 +1,9 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, buildPackages
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, installShellFiles
|
||||
, testers
|
||||
, trivy
|
||||
}:
|
||||
@ -29,9 +32,22 @@ buildGoModule rec {
|
||||
"-X=github.com/aquasecurity/trivy/pkg/version.ver=v${version}"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
# Tests require network access
|
||||
doCheck = false;
|
||||
|
||||
postInstall =
|
||||
let
|
||||
trivy = if stdenv.buildPlatform.canExecute stdenv.hostPlatform then placeholder "out" else buildPackages.trivy;
|
||||
in
|
||||
''
|
||||
installShellCompletion --cmd trivy \
|
||||
--bash <(${trivy}/bin/trivy completion bash) \
|
||||
--fish <(${trivy}/bin/trivy completion fish) \
|
||||
--zsh <(${trivy}/bin/trivy completion zsh)
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
|
Loading…
Reference in New Issue
Block a user