|
| 1 | +class Oasis < Formula |
| 2 | + desc "CLI for interacting with the Oasis Protocol network" |
| 3 | + homepage "https://github.com/oasisprotocol/cli" |
| 4 | + url "https://github.com/oasisprotocol/cli/archive/refs/tags/v0.14.3.tar.gz" |
| 5 | + sha256 "6e8a3de59931ac81e6fc77cfc01553041b1b08e159a6d1547b6ffdcddcffb13a" |
| 6 | + license "Apache-2.0" |
| 7 | + head "https://github.com/oasisprotocol/cli.git", branch: "master" |
| 8 | + |
| 9 | + bottle do |
| 10 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "ed77c8a7b8251541519fb70981b6f48305c9c6681bf064fe2a9dbbf10b178485" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "e43e7bc979d22d67ccfad65a905ee8d31fb897f0e51e1ac29adf943313106558" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "6cdc971d22cf1c3c357552c315ee00d0ec5bb1f2f0a43dc29065b52e57fc96e5" |
| 13 | + sha256 cellar: :any_skip_relocation, sonoma: "02f0cc113b4d7f4b05b6d574ba34166728e92736fc86fe17917fe10c96631ae5" |
| 14 | + sha256 cellar: :any_skip_relocation, ventura: "f251488246f48baac3d7fca525bf9553a57db175541178dc81374d546fa96889" |
| 15 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "94210af3e16e15a7eea6e6157b86dae9f8dd4729cc0630ec7d006caecab97fc0" |
| 16 | + end |
| 17 | + |
| 18 | + depends_on "go" => :build |
| 19 | + |
| 20 | + def install |
| 21 | + ldflags = %W[ |
| 22 | + -s -w |
| 23 | + -X github.com/oasisprotocol/cli/version.Software=#{version} |
| 24 | + -X github.com/oasisprotocol/cli/cmd.DisableUpdateCmd=true |
| 25 | + ] |
| 26 | + |
| 27 | + system "go", "build", *std_go_args(ldflags:) |
| 28 | + end |
| 29 | + |
| 30 | + test do |
| 31 | + assert_match version.to_s, shell_output("#{bin}/oasis --version") |
| 32 | + assert_match "CLI for interacting with the Oasis network", shell_output("#{bin}/oasis --help") |
| 33 | + assert_match "Error: unknown command \"update\" for \"oasis\"", shell_output("#{bin}/oasis update 2>&1", 1) |
| 34 | + assert_match "Error: no address given and no wallet configured", shell_output("#{bin}/oasis account show 2>&1", 1) |
| 35 | + end |
| 36 | +end |
0 commit comments