argo: install completions

This commit is contained in:
Mario Rodas 2020-06-25 22:01:51 -05:00
parent 4d6876aeef
commit a7f888e5f3
No known key found for this signature in database
GPG Key ID: 325649BCA6D53027

View File

@ -1,4 +1,4 @@
{ lib, buildGoModule, buildGoPackage, fetchFromGitHub }: { lib, buildGoModule, buildGoPackage, fetchFromGitHub, installShellFiles }:
let let
# Argo can package a static server in the CLI using the `staticfiles` go module. # Argo can package a static server in the CLI using the `staticfiles` go module.
@ -32,6 +32,8 @@ buildGoModule rec {
subPackages = [ "cmd/argo" ]; subPackages = [ "cmd/argo" ];
nativeBuildInputs = [ installShellFiles ];
preBuild = '' preBuild = ''
mkdir -p ui/dist/app mkdir -p ui/dist/app
echo "Built without static files" > ui/dist/app/index.html echo "Built without static files" > ui/dist/app/index.html
@ -48,6 +50,13 @@ buildGoModule rec {
-X github.com/argoproj/argo.gitTag=${version} -X github.com/argoproj/argo.gitTag=${version}
''; '';
postInstall = ''
for shell in bash zsh; do
$out/bin/argo completion $shell > argo.$shell
installShellCompletion argo.$shell
done
'';
meta = with lib; { meta = with lib; {
description = "Container native workflow engine for Kubernetes"; description = "Container native workflow engine for Kubernetes";
homepage = "https://github.com/argoproj/argo"; homepage = "https://github.com/argoproj/argo";