diff options
author | 06kellyjac <dev@j-k.io> | 2022-04-07 11:29:06 +0100 |
---|---|---|
committer | 06kellyjac <dev@j-k.io> | 2022-04-27 14:52:22 +0100 |
commit | b536cc5b253c852e39f42e73fedab501aadc1f27 (patch) | |
tree | 3e563cdfe15655b4ea1abd020c42e43910172d30 /pkgs/tools/admin/stripe-cli | |
parent | 53491f56b602013d217d878669282c0439e208bf (diff) |
stripe-cli: 1.8.4 -> 1.8.8
Added ldflags -s -w makes the binary 2MB smaller -X ... adds the version details Added the tests Added shell completions Added changelog and longDescription Added myself as a maintainer
Diffstat (limited to 'pkgs/tools/admin/stripe-cli')
-rw-r--r-- | pkgs/tools/admin/stripe-cli/default.nix | 55 |
1 files changed, 48 insertions, 7 deletions
diff --git a/pkgs/tools/admin/stripe-cli/default.nix b/pkgs/tools/admin/stripe-cli/default.nix index e3241aacab698..a02e34df631d4 100644 --- a/pkgs/tools/admin/stripe-cli/default.nix +++ b/pkgs/tools/admin/stripe-cli/default.nix @@ -1,27 +1,68 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, installShellFiles, stdenv }: buildGoModule rec { pname = "stripe-cli"; - version = "1.8.4"; + version = "1.8.8"; src = fetchFromGitHub { owner = "stripe"; repo = pname; rev = "v${version}"; - sha256 = "sha256-TP366SozSNfxUGYXIOObfIul0BhQtIGQYZLwH/TPFs0="; + sha256 = "sha256-frVQ2nqOflY26ZZWVYJGMNMOdbLuIojQDu/79kLilBk="; }; - vendorSha256 = "sha256-1c+YtfRy1ey0z117YHHkrCnpb7g+DmM+LR1rjn1YwMQ="; - subPackages = [ - "cmd/stripe" + nativeBuildInputs = [ installShellFiles ]; + + ldflags = [ + "-s" + "-w" + "-X github.com/stripe/stripe-cli/pkg/version.Version=${version}" ]; + preCheck = '' + # the tests expect the Version ldflag not to be set + unset ldflags + '' + lib.optionalString ( + # delete plugin tests on all platforms but exact matches + # https://github.com/stripe/stripe-cli/issues/850 + ! lib.lists.any + (platform: lib.meta.platformMatch stdenv.hostPlatform platform) + [ "x86_64-linux" "x86_64-darwin" ] + ) '' + rm pkg/plugins/plugin_test.go + ''; + + postInstall = '' + installShellCompletion --cmd stripe \ + --bash <($out/bin/stripe completion --write-to-stdout --shell bash) \ + --zsh <($out/bin/stripe completion --write-to-stdout --shell zsh) + ''; + + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + $out/bin/stripe --help + $out/bin/stripe --version | grep "${version}" + runHook postInstallCheck + ''; + meta = with lib; { homepage = "https://stripe.com/docs/stripe-cli"; + changelog = "https://github.com/stripe/stripe-cli/releases/tag/v${version}"; description = "A command-line tool for Stripe"; + longDescription = '' + The Stripe CLI helps you build, test, and manage your Stripe integration + right from the terminal. + + With the CLI, you can: + Securely test webhooks without relying on 3rd party software + Trigger webhook events or resend events for easy testing + Tail your API request logs in real-time + Create, retrieve, update, or delete API objects. + ''; license = with licenses; [ asl20 ]; - maintainers = with maintainers; [ RaghavSood ]; + maintainers = with maintainers; [ RaghavSood jk ]; mainProgram = "stripe"; }; } |