Merge pull request #214715 from viraptor/viraptor/cobra-cli-year-fix

cobra-cli: fix the build
This commit is contained in:
Stanisław Pitucha 2023-02-06 19:53:08 +11:00 committed by GitHub
commit 918fa4e3af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, go }:
buildGoModule rec {
pname = "cobra-cli";
@ -13,6 +13,22 @@ buildGoModule rec {
vendorSha256 = "sha256-vrtGPQzY+NImOGaSxV+Dvch+GNPfL9XfY4lfCHTGXwY=";
nativeBuildInputs = [ makeWrapper ];
allowGoReference = true;
postPatch = ''
substituteInPlace "cmd/add_test.go" \
--replace "TestGoldenAddCmd" "SkipGoldenAddCmd"
substituteInPlace "cmd/init_test.go" \
--replace "TestGoldenInitCmd" "SkipGoldenInitCmd"
'';
postFixup = ''
wrapProgram "$out/bin/cobra-cli" \
--prefix PATH : ${go}/bin
'';
meta = with lib; {
description = "Cobra CLI tool to generate applications and commands";
homepage = "https://github.com/spf13/cobra-cli/";