Commit 5ddda189 authored by aleksana's avatar aleksana
Browse files

amber-lang: generate bash completion

parent d9371554
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@
  bc,
  util-linux,
  makeWrapper,
  installShellFiles,
  stdenv,
  runCommand,
  amber-lang,
  nix-update-script,
@@ -29,7 +31,10 @@ rustPlatform.buildRustPackage rec {
      --replace-fail 'Command::new("/usr/bin/env")' 'Command::new("env")'
  '';

  nativeBuildInputs = [ makeWrapper ];
  nativeBuildInputs = [
    makeWrapper
    installShellFiles
  ];

  nativeCheckInputs = [
    bc
@@ -43,8 +48,13 @@ rustPlatform.buildRustPackage rec {
    "--skip=tests::formatter::all_exist"
  ];

  postInstall = ''
  postInstall =
    ''
      wrapProgram "$out/bin/amber" --prefix PATH : "${lib.makeBinPath [ bc ]}"
    ''
    + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
      installShellCompletion --cmd amber \
        --bash <($out/bin/amber completion)
    '';

  passthru = {