git.iko.soy/typeable/nixpkgs
on master help sign in
fly: use completion generator

There's no need to ship the pre-generated completions in the nixpkgs tree anymore.

commit5d362c2335eee327aab027625b0095bf2d87468c authorFlorian Klink <flokli@flokli.de> dateFri 15 May 2020, 13:47 (7 years ago) parente4d710b
2 files changed+5−17
pkgs/development/tools/continuous-integration/fly/default.nix+5−7 pkgs/development/tools/continuous-integration/fly/fly.bash−10
pkgs/development/tools/continuous-integration/fly/default.nix+5−7
@@ -1,4 +1,4 @@
1−{ buildGoModule, fetchFromGitHub, lib, writeText }:
1+{ buildGoModule, fetchFromGitHub, stdenv, lib, writeText }:
22
33buildGoModule rec {
44 pname = "fly";
@@ -20,12 +20,10 @@ buildGoModule rec {
2020 -X github.com/concourse/concourse.Version=${version}
2121 '';
2222
23− # The fly.bash file included with this derivation can be replaced by a
24− # call to `fly completion bash` once the `completion` subcommand has
25− # made it into a release. Similarly, `fly completion zsh` will provide
26− # zsh completions. https://github.com/concourse/concourse/pull/4012
27− postInstall = ''
28− install -D -m 444 ${./fly.bash} $out/share/bash-completion/completions/fly
23+ postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
24+ mkdir -p $out/share/{bash-completion/completions,zsh/site-functions}
25+ $out/bin/fly completion --shell bash > $out/share/bash-completion/completions/fly
26+ $out/bin/fly completion --shell zsh > $out/share/zsh/site-functions/_fly
2927 '';
3028
3129 meta = with lib; {
pkgs/development/tools/continuous-integration/fly/fly.bashdeleted−10
@@ -1,10 +0,0 @@
1−# credits:
2−# https://godoc.org/github.com/jessevdk/go-flags#hdr-Completion
3−# https://github.com/concourse/concourse/issues/1309#issuecomment-452893900
4−_fly_compl() {
5− args=("${COMP_WORDS[@]:1:$COMP_CWORD}")
6− local IFS=$'\n'
7− COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}"))
8− return 0
9−}
10−complete -F _fly_compl fly