Unverified Commit 919cb291 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

pet: add bash and fish shell completions (#399954)

parents 0d6e8efb 6021a59e
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildGoModule,
  fetchFromGitHub,
  installShellFiles,
  lib,
  writableTmpDirAsHomeHook,
}:

buildGoModule rec {
@@ -30,11 +32,14 @@ buildGoModule rec {

  nativeBuildInputs = [
    installShellFiles
    writableTmpDirAsHomeHook
  ];

  postInstall = ''
  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd pet \
      --zsh ./misc/completions/zsh/_pet
      --bash <($out/bin/pet completion bash) \
      --fish <($out/bin/pet completion fish) \
      --zsh $src/misc/completions/zsh/_pet
  '';

  meta = with lib; {