qovery-cli: add version test and shell completion

This commit is contained in:
superherointj 2022-09-05 04:00:24 -03:00
parent 4ee08b8bb2
commit 6d492c330d

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";