2022-04-27 09:35:20 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, stdenv }:
|
2020-10-19 00:13:06 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "stripe-cli";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.19.5";
|
2020-10-19 00:13:06 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stripe";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-gunLbZOT0cnWGxc6714XcPdHJVK4LbDBwC2zt03WrUM=";
|
2020-10-19 00:13:06 +00:00
|
|
|
};
|
2024-05-15 15:35:15 +00:00
|
|
|
vendorHash = "sha256-xFWU+OazwLTb5qdFeYth1MlPJ76nEK4qSCNGVhC/PxE=";
|
2020-10-19 00:13:06 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/stripe/stripe-cli/pkg/version.Version=${version}"
|
2020-10-19 00:13:06 +00:00
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
preCheck = ''
|
|
|
|
# the tests expect the Version ldflag not to be set
|
|
|
|
unset ldflags
|
2023-03-24 00:07:29 +00:00
|
|
|
|
|
|
|
# requires internet access
|
|
|
|
rm pkg/cmd/plugin_cmds_test.go
|
|
|
|
rm pkg/cmd/resources_test.go
|
|
|
|
rm pkg/cmd/root_test.go
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# TODO: no clue why it's broken (1.17.1), remove for now.
|
2023-03-24 00:07:29 +00:00
|
|
|
rm pkg/login/client_login_test.go
|
|
|
|
rm pkg/git/editor_test.go
|
|
|
|
rm pkg/rpcservice/sample_create_test.go
|
2022-04-27 09:35:20 +00:00
|
|
|
'' + 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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
homepage = "https://stripe.com/docs/stripe-cli";
|
2022-04-27 09:35:20 +00:00
|
|
|
changelog = "https://github.com/stripe/stripe-cli/releases/tag/v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Command-line tool for Stripe";
|
2022-04-27 09:35:20 +00:00
|
|
|
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.
|
|
|
|
'';
|
2020-10-19 00:13:06 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ RaghavSood jk kashw2 ];
|
2022-04-03 18:54:34 +00:00
|
|
|
mainProgram = "stripe";
|
2020-10-19 00:13:06 +00:00
|
|
|
};
|
|
|
|
}
|