gh: modernize
installBin, structuredAttrs, and versionCheckHook Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
buildGoModule,
|
||||
installShellFiles,
|
||||
stdenv,
|
||||
testers,
|
||||
versionCheckHook,
|
||||
makeWrapper,
|
||||
}:
|
||||
|
||||
@@ -12,6 +12,8 @@ buildGoModule (finalAttrs: {
|
||||
pname = "gh";
|
||||
version = "2.92.0";
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cli";
|
||||
repo = "cli";
|
||||
@@ -36,7 +38,7 @@ buildGoModule (finalAttrs: {
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dm755 bin/gh -t $out/bin
|
||||
installBin bin/gh
|
||||
wrapProgram $out/bin/gh \
|
||||
--set-default GH_TELEMETRY false
|
||||
''
|
||||
@@ -55,9 +57,8 @@ buildGoModule (finalAttrs: {
|
||||
# most tests require network access
|
||||
doCheck = false;
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
package = finalAttrs.finalPackage;
|
||||
};
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
doInstallCheck = true;
|
||||
|
||||
meta = {
|
||||
description = "GitHub CLI tool";
|
||||
|
||||
Reference in New Issue
Block a user