-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2143,6 +2143,7 @@ stow | |
strace | ||
streamlink | ||
stress-ng | ||
stripe-cli | ||
stripe-mock | ||
strongswan | ||
structurizr-cli | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |