|
| 1 | +class IcebergCli < Formula |
| 2 | + desc "Command-line interface for Apache Iceberg" |
| 3 | + homepage "https://go.iceberg.apache.org/cli.html" |
| 4 | + url "https://github.com/apache/iceberg-go/archive/refs/tags/v0.3.0.tar.gz" |
| 5 | + sha256 "3bf2bb338676161db4896b1748879cc211ea12d9ad9ea5dd845dde12af271249" |
| 6 | + license "Apache-2.0" |
| 7 | + |
| 8 | + bottle do |
| 9 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "647a30360d91f967cb13355a298d5eaa17aef1a33fd80b40eeb832225747d77c" |
| 10 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "647a30360d91f967cb13355a298d5eaa17aef1a33fd80b40eeb832225747d77c" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "647a30360d91f967cb13355a298d5eaa17aef1a33fd80b40eeb832225747d77c" |
| 12 | + sha256 cellar: :any_skip_relocation, sonoma: "98428be6efcefb5a5e390c480b89e26424da60ee1cf0f56624a1c5f9c5f91f20" |
| 13 | + sha256 cellar: :any_skip_relocation, ventura: "98428be6efcefb5a5e390c480b89e26424da60ee1cf0f56624a1c5f9c5f91f20" |
| 14 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "fa20e65aadbb859fe41865cb7cce175052cba10bd729b5421a5a3f051dd825a4" |
| 15 | + end |
| 16 | + |
| 17 | + depends_on "go" => :build |
| 18 | + |
| 19 | + def install |
| 20 | + # See: https://github.com/apache/iceberg-go/pull/531 |
| 21 | + inreplace "utils.go", "(unknown version)", version.to_s |
| 22 | + |
| 23 | + system "go", "build", *std_go_args(output: bin/"iceberg"), "./cmd/iceberg" |
| 24 | + end |
| 25 | + |
| 26 | + test do |
| 27 | + assert_match version.to_s, shell_output("#{bin}/iceberg --version") |
| 28 | + output = shell_output("#{bin}/iceberg list 2>&1", 1) |
| 29 | + assert_match "unsupported protocol scheme", output |
| 30 | + end |
| 31 | +end |
0 commit comments