jx: install completions

This commit is contained in:
Mario Rodas 2020-08-02 04:20:00 -05:00
parent 42b1a207c9
commit ca9f18df45

View File

@ -1,4 +1,4 @@
{ buildGoModule, fetchFromGitHub, lib }: { buildGoModule, fetchFromGitHub, lib, installShellFiles }:
buildGoModule rec { buildGoModule rec {
pname = "jx"; pname = "jx";
@ -15,12 +15,21 @@ buildGoModule rec {
subPackages = [ "cmd/jx" ]; subPackages = [ "cmd/jx" ];
nativeBuildInputs = [ installShellFiles ];
buildFlagsArray = '' buildFlagsArray = ''
-ldflags= -ldflags=
-X github.com/jenkins-x/jx/pkg/version.Version=${version} -X github.com/jenkins-x/jx/pkg/version.Version=${version}
-X github.com/jenkins-x/jx/pkg/version.Revision=${version} -X github.com/jenkins-x/jx/pkg/version.Revision=${version}
''; '';
postInstall = ''
for shell in bash zsh; do
$out/bin/jx completion $shell > jx.$shell
installShellCompletion jx.$shell
done
'';
meta = with lib; { meta = with lib; {
description = "JX is a command line tool for installing and using Jenkins X."; description = "JX is a command line tool for installing and using Jenkins X.";
homepage = "https://jenkins-x.io"; homepage = "https://jenkins-x.io";