Skip to content

Commit

Permalink
pulsarctl 3.3.0.3 (new formula)
Browse files Browse the repository at this point in the history
  • Loading branch information
branchvincent committed Jun 22, 2024
1 parent 368022c commit 4bd8f0e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Formula/p/pulsarctl.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
class Pulsarctl < Formula
desc "CLI for Apache Pulsar written in Go"
homepage "https://streamnative.io/"
url "https://github.com/streamnative/pulsarctl/archive/refs/tags/v3.3.0.3.tar.gz"
sha256 "8171726d64266b569fae1c6b7fadcc99f90e4117aef2e71ff54f992afbc7939e"
license "Apache-2.0"
head "https://github.com/streamnative/pulsarctl.git", branch: "master"

livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end

depends_on "go" => :build

def install
ldflags = %W[
-s -w
-X github.com/streamnative/pulsarctl/pkg/cmdutils.ReleaseVersion=v#{version}
-X github.com/streamnative/pulsarctl/pkg/cmdutils.BuildTS=#{time.iso8601}
-X github.com/streamnative/pulsarctl/pkg/cmdutils.GitHash=#{tap.user}
-X github.com/streamnative/pulsarctl/pkg/cmdutils.GitBranch=master
-X github.com/streamnative/pulsarctl/pkg/cmdutils.GoVersion=go#{Formula["go"].version}
]
system "go", "build", *std_go_args(ldflags:)

# Install shell completions
generate_completions_from_executable(bin/"pulsarctl", "completion")
end

test do
assert_match version.to_s, shell_output("#{bin}/pulsarctl --version")
assert_match "connection refused", shell_output("#{bin}/pulsarctl clusters list 2>&1", 1)
end
end

0 comments on commit 4bd8f0e

Please sign in to comment.