Unverified Commit 27206f59 authored by Arne Keller's avatar Arne Keller Committed by GitHub
Browse files

tilt: add completions (#374349)

parents 45c96da3 6b04132c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@
  src,
  version,
  tilt-assets,
  stdenv,
  installShellFiles,
}:

buildGoModule rec {
@@ -21,6 +23,15 @@ buildGoModule rec {

  ldflags = [ "-X main.version=${version}" ];

  nativeBuildInputs = [ installShellFiles ];

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

  preBuild = ''
    mkdir -p pkg/assets/build
    cp -r ${tilt-assets}/* pkg/assets/build/