fly: use completion generator

There's no need to ship the pre-generated completions in the nixpkgs
tree anymore.
This commit is contained in:
Florian Klink
2020-05-15 13:53:14 +02:00
parent e4d710b1c9
commit 5d362c2335
2 changed files with 5 additions and 17 deletions
@@ -1,4 +1,4 @@
{ buildGoModule, fetchFromGitHub, lib, writeText }:
{ buildGoModule, fetchFromGitHub, stdenv, lib, writeText }:
buildGoModule rec {
pname = "fly";
@@ -20,12 +20,10 @@ buildGoModule rec {
-X github.com/concourse/concourse.Version=${version}
'';
# The fly.bash file included with this derivation can be replaced by a
# call to `fly completion bash` once the `completion` subcommand has
# made it into a release. Similarly, `fly completion zsh` will provide
# zsh completions. https://github.com/concourse/concourse/pull/4012
postInstall = ''
install -D -m 444 ${./fly.bash} $out/share/bash-completion/completions/fly
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
mkdir -p $out/share/{bash-completion/completions,zsh/site-functions}
$out/bin/fly completion --shell bash > $out/share/bash-completion/completions/fly
$out/bin/fly completion --shell zsh > $out/share/zsh/site-functions/_fly
'';
meta = with lib; {