Unverified Commit 560499df authored by Amadej Kastelic's avatar Amadej Kastelic
Browse files

mbake: install completions

parent c1e3dac4
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  fetchFromGitHub,
  installShellFiles,
  python3Packages,
  versionCheckHook,
}:
@@ -18,6 +20,7 @@ python3Packages.buildPythonApplication rec {
  };

  build-system = [
    installShellFiles
    python3Packages.hatchling
  ];

@@ -26,6 +29,13 @@ python3Packages.buildPythonApplication rec {
    typer
  ];

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

  nativeCheckInputs = [
    python3Packages.pytestCheckHook
    versionCheckHook