|
| 1 | +class Lazycontainer < Formula |
| 2 | + desc "Terminal UI for Apple Containers" |
| 3 | + homepage "https://github.com/andreybleme/lazycontainer" |
| 4 | + url "https://github.com/andreybleme/lazycontainer/archive/refs/tags/v0.0.1.tar.gz" |
| 5 | + sha256 "c674297ccb1c3897865e4dd14d64ce7346f04f66430c125ad6c8bdfff0ba4228" |
| 6 | + license "MIT" |
| 7 | + head "https://github.com/andreybleme/lazycontainer.git", branch: "main" |
| 8 | + |
| 9 | + bottle do |
| 10 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "0dc4071f1c199b099256ecbfae20165aefbeef9e9df7a0262d485f346039d13c" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "0dc4071f1c199b099256ecbfae20165aefbeef9e9df7a0262d485f346039d13c" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "0dc4071f1c199b099256ecbfae20165aefbeef9e9df7a0262d485f346039d13c" |
| 13 | + sha256 cellar: :any_skip_relocation, sonoma: "9ce2b590419deecde11f0a99a3cb3a22591ddc7a80a6074c867394baa7d8da66" |
| 14 | + sha256 cellar: :any_skip_relocation, ventura: "9ce2b590419deecde11f0a99a3cb3a22591ddc7a80a6074c867394baa7d8da66" |
| 15 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "b28e111c6514af466fa079101c6b027f543f7c23193dd3c65056429c7e933122" |
| 16 | + end |
| 17 | + |
| 18 | + depends_on "go" => :build |
| 19 | + |
| 20 | + def install |
| 21 | + system "go", "build", *std_go_args(ldflags: "-s -w"), "./cmd" |
| 22 | + end |
| 23 | + |
| 24 | + test do |
| 25 | + require "pty" |
| 26 | + |
| 27 | + PTY.spawn(bin/"lazycontainer") do |r, _w, pid| |
| 28 | + out = r.readpartial(1024) |
| 29 | + assert_match "Error listing containers", out |
| 30 | + rescue Errno::EIO |
| 31 | + # GNU/Linux raises EIO when read is done on closed pty |
| 32 | + ensure |
| 33 | + Process.kill("TERM", pid) |
| 34 | + Process.wait(pid) |
| 35 | + end |
| 36 | + end |
| 37 | +end |
0 commit comments