Merge pull request #79199 from zowoq/gh

gitAndTools.gh: init at 0.5.3
This commit is contained in:
worldofpeace 2020-02-03 23:40:08 -05:00 committed by GitHub
commit d765d00a79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 0 deletions

View File

@ -28,6 +28,8 @@ let
diff-so-fancy = callPackage ./diff-so-fancy { };
gh = callPackage ./gh { };
ghq = callPackage ./ghq { };
git = appendToName "minimal" gitBase;

View File

@ -0,0 +1,36 @@
{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:
buildGoModule rec {
pname = "gh";
version = "0.5.3";
src = fetchFromGitHub {
owner = "cli";
repo = "cli";
rev = "v${version}";
sha256 = "033y9bwdaj8735nmj22k8lrgkgimji7hyly9i4jyp11iaa7cgd7a";
};
modSha256 = "0ina3m2ixkkz2fws6ifwy34pmp6kn5s3j7w40alz6vmybn2smy1h";
buildFlagsArray = [
"-ldflags=-X github.com/cli/cli/command.Version=${version}"
];
subPackages = [ "cmd/gh" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
for shell in bash fish zsh; do
$out/bin/gh completion -s $shell > gh.$shell
installShellCompletion gh.$shell
done
'';
meta = with lib; {
description = "GitHub CLI tool";
homepage = "https://github.com/cli/cli";
license = licenses.mit;
maintainers = with maintainers; [ zowoq ];
};
}