Unverified Commit 980cec0f authored by Jonathan Davies's avatar Jonathan Davies
Browse files

vector: Install shell completions

parent 8da4a409
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  stdenv,
  lib,
  fetchFromGitHub,
  installShellFiles,
  rustPlatform,
  pkg-config,
  openssl,
@@ -43,6 +44,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
    perl
    git
    rustPlatform.bindgenHook
    installShellFiles
  ]
  # Provides the mig command used by the build scripts
  ++ lib.optional stdenv.hostPlatform.isDarwin darwin.bootstrap_cmds;
@@ -116,6 +118,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
      --replace-fail "#[tokio::test]" ""
  '';

  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    for shell in bash fish zsh; do
      installShellCompletion --cmd vector --$shell <($out/bin/vector completion $shell)
    done
  '';

  nativeInstallCheckInputs = [
    versionCheckHook
  ];