Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stripe-cli 1.19.5 (new formula) #172482

Merged
merged 2 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/autobump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2143,6 +2143,7 @@ stow
strace
streamlink
stress-ng
stripe-cli
stripe-mock
strongswan
structurizr-cli
Expand Down
29 changes: 29 additions & 0 deletions Formula/s/stripe-cli.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class StripeCli < Formula
desc "Command-line tool for Stripe"
homepage "https://stripe.com/docs/stripe-cli"
url "https://github.com/stripe/stripe-cli/archive/refs/tags/v1.19.5.tar.gz"
sha256 "3b59dbc36c66b8021c3c35c1a8d05426f3441c4848b7100469f34360061c1347"
license "Apache-2.0"

depends_on "go" => :build

def install
# See configuration in `.goreleaser` directory
ENV["CGO_ENABLED"] = OS.mac? ? "1" : "0"
ldflags = %W[-s -w -X github.com/stripe/stripe-cli/pkg/version.Version=#{version}]
system "go", "build", *std_go_args(ldflags:, output: bin/"stripe"), "cmd/stripe/main.go"

# Doesn't work with `generate_completions_from_executable`
# Taken from `.goreleaser` directory
system bin/"stripe", "completion", "--shell", "bash"
system bin/"stripe", "completion", "--shell", "zsh"
bash_completion.install "stripe-completion.bash"
zsh_completion.install "stripe-completion.zsh" => "_stripe"
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved
end

test do
assert_match version.to_s, shell_output("#{bin}/stripe version")
assert_match "secret or restricted key",
shell_output("#{bin}/stripe --api-key=not_real_key get ch_1EGYgUByst5pquEtjb0EkYha", 1)
end
end
Loading