Skip to content

Commit

Permalink
stripe-cli 1.19.5 (new formula)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocab committed May 24, 2024
1 parent 83fceae commit b106b17
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
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"
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

0 comments on commit b106b17

Please sign in to comment.