|
| 1 | +class GoPassboltCli < Formula |
| 2 | + desc "CLI for passbolt" |
| 3 | + homepage "https://www.passbolt.com/" |
| 4 | + url "https://github.com/passbolt/go-passbolt-cli/archive/refs/tags/v0.3.2.tar.gz" |
| 5 | + sha256 "4e88aa088b68a7101ca89a97184eb5427aa9b70d52df077f7d56c2ff3672fe06" |
| 6 | + license "MIT" |
| 7 | + head "https://github.com/passbolt/go-passbolt-cli.git", branch: "main" |
| 8 | + |
| 9 | + bottle do |
| 10 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "76c8a1220e7d1fcac1d8dad53d317b0b384bb36a4d83abfda0185589cccd8141" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "76c8a1220e7d1fcac1d8dad53d317b0b384bb36a4d83abfda0185589cccd8141" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "76c8a1220e7d1fcac1d8dad53d317b0b384bb36a4d83abfda0185589cccd8141" |
| 13 | + sha256 cellar: :any_skip_relocation, sonoma: "18c3ac460121631899b078594d6082dc038b72492232ad4640ca70712c1f2784" |
| 14 | + sha256 cellar: :any_skip_relocation, ventura: "18c3ac460121631899b078594d6082dc038b72492232ad4640ca70712c1f2784" |
| 15 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "2547a6b87ff2587b9e75f2a3b54317c25634d2b1d76656ddb2e93f6bfa978003" |
| 16 | + end |
| 17 | + |
| 18 | + depends_on "go" => :build |
| 19 | + |
| 20 | + def install |
| 21 | + ldflags = "-s -w -X main.version=#{version} -X main.commit=#{tap.user} -X main.date=#{time.iso8601}" |
| 22 | + system "go", "build", *std_go_args(ldflags:, output: bin/"passbolt") |
| 23 | + |
| 24 | + generate_completions_from_executable(bin/"passbolt", "completion") |
| 25 | + mkdir "man" |
| 26 | + system bin/"passbolt", "gendoc", "--type", "man" |
| 27 | + man1.install Dir["man/*.1"] |
| 28 | + end |
| 29 | + |
| 30 | + test do |
| 31 | + assert_match version.to_s, shell_output("#{bin}/passbolt --version") |
| 32 | + assert_match "Error: serverAddress is not defined", shell_output("#{bin}/passbolt list user 2>&1", 1) |
| 33 | + end |
| 34 | +end |
0 commit comments