Skip to content

Commit

Permalink
circleci-cli: Add shell completions
Browse files Browse the repository at this point in the history
  • Loading branch information
avdv committed Sep 14, 2022
1 parent 2eeaffd commit 0620a73
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkgs/development/tools/misc/circleci-cli/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, fetchFromGitHub, buildGoModule }:
{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:

buildGoModule rec {
pname = "circleci-cli";
Expand All @@ -13,12 +13,18 @@ buildGoModule rec {

vendorSha256 = "sha256-jrAd1G/NCjXfaJmzOhMjMZfJoGHsQ1bi3HudBM0e8rE=";

nativeBuildInputs = [ installShellFiles ];

doCheck = false;

ldflags = [ "-s" "-w" "-X github.com/CircleCI-Public/circleci-cli/version.Version=${version}" "-X github.com/CircleCI-Public/circleci-cli/version.Commit=${src.rev}" "-X github.com/CircleCI-Public/circleci-cli/version.packageManager=nix" ];

postInstall = ''
mv $out/bin/circleci-cli $out/bin/circleci
installShellCompletion --cmd circleci \
--bash <($out/bin/circleci completion bash --skip-update-check) \
--zsh <($out/bin/circleci completion zsh --skip-update-check)
'';

meta = with lib; {
Expand Down

0 comments on commit 0620a73

Please sign in to comment.