Merge pull request #87885 from flokli/fly-6.1.0

fly: 6.0.0 -> 6.1.0
This commit is contained in:
Florian Klink 2020-05-15 21:21:15 +02:00 committed by GitHub
commit b611581162
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 21 deletions

View file

@ -1,17 +1,17 @@
{ buildGoModule, fetchFromGitHub, lib, writeText }:
{ buildGoModule, fetchFromGitHub, stdenv, lib, writeText }:
buildGoModule rec {
pname = "fly";
version = "6.0.0";
version = "6.1.0";
src = fetchFromGitHub {
owner = "concourse";
repo = "concourse";
rev = "v${version}";
sha256 = "0chavwymyh5kv4fkvdjvf3p5jjx4yn9aavq66333xnsl5pn7q9dq";
sha256 = "14sm3xwhm6pfln18i9f9dyj7s2wcri43rxj4s1cja7nwqr5sqb3x";
};
vendorSha256 = "127mc1wzqhn0l4ni6qxcx06qfdb1cgahzypjrs4vgr6i4sipjxck";
vendorSha256 = "1c099sn5rrvj805va1lyjlbv7i2g1z5bxyaisv5l9365z0lv1cwm";
subPackages = [ "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; {
@ -34,4 +32,4 @@ buildGoModule rec {
license = licenses.asl20;
maintainers = with maintainers; [ ivanbrennan ];
};
}
}

View file

@ -1,10 +0,0 @@
# credits:
# https://godoc.org/github.com/jessevdk/go-flags#hdr-Completion
# https://github.com/concourse/concourse/issues/1309#issuecomment-452893900
_fly_compl() {
args=("${COMP_WORDS[@]:1:$COMP_CWORD}")
local IFS=$'\n'
COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}"))
return 0
}
complete -F _fly_compl fly