Merge pull request #189816 from superherointj/package-qovery-cli-add-shell-completion

qovery-cli: add version test and shell completion
This commit is contained in:
Fabian Affolter 2022-09-07 08:46:33 +02:00 committed by GitHub
commit 11fdcc5b0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,9 @@
{ lib
, buildGoModule
{ buildGoModule
, fetchFromGitHub
, installShellFiles
, lib
, qovery-cli
, testers
}:
buildGoModule rec {
@ -16,6 +19,20 @@ buildGoModule rec {
vendorSha256 = "sha256-4TY7/prMbvw5zVPJRoMLg7Omrxvh1HPGsdz1wqPn4uU=";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd ${pname} \
--bash <($out/bin/${pname} completion bash) \
--fish <($out/bin/${pname} completion fish) \
--zsh <($out/bin/${pname} completion zsh)
'';
passthru.tests.version = testers.testVersion {
package = qovery-cli;
command = "HOME=$(mktemp -d); ${pname} version";
};
meta = with lib; {
description = "Qovery Command Line Interface";
homepage = "https://github.com/Qovery/qovery-cli";