woodpecker-cli: install autocompletion for bash/fish/zsh
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
{ buildGoModule, callPackage }:
|
||||
{
|
||||
buildGoModule,
|
||||
callPackage,
|
||||
installShellFiles,
|
||||
lib,
|
||||
stdenv,
|
||||
}:
|
||||
let
|
||||
common = callPackage ./common.nix { };
|
||||
in
|
||||
@@ -8,13 +14,23 @@ buildGoModule {
|
||||
version
|
||||
src
|
||||
ldflags
|
||||
postInstall
|
||||
vendorHash
|
||||
;
|
||||
|
||||
subPackages = "cmd/cli";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
env.CGO_ENABLED = 0;
|
||||
postInstall = ''
|
||||
${common.postInstall}
|
||||
''
|
||||
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd woodpecker-cli \
|
||||
--bash <($out/bin/woodpecker-cli completion bash) \
|
||||
--fish <($out/bin/woodpecker-cli completion fish ) \
|
||||
--zsh <($out/bin/woodpecker-cli completion zsh)
|
||||
'';
|
||||
|
||||
meta = common.meta // {
|
||||
description = "Command line client for the Woodpecker Continuous Integration server";
|
||||
|
||||
Reference in New Issue
Block a user