|
| 1 | +class Clippy < Formula |
| 2 | + desc "Copy files from your terminal that actually paste into GUI apps" |
| 3 | + homepage "https://github.com/neilberkman/clippy" |
| 4 | + url "https://github.com/neilberkman/clippy/archive/refs/tags/v1.5.1.tar.gz" |
| 5 | + sha256 "e1775535ee7b00ba1344696d0d60ae8067b445fa0e3b9ffb5fdfb56a0a10a0be" |
| 6 | + license "MIT" |
| 7 | + |
| 8 | + bottle do |
| 9 | + sha256 cellar: :any_skip_relocation, arm64_tahoe: "85a30b02ea2324f7a0926268ded16b7a7c83422cc48f9b1cfeac1fc1e93a56c5" |
| 10 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "9082c3d04f630353c7e24f177059ff054ac3863b2fb8243c00c923dba4acaee1" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "0b35fa12fb7ee1fa69cc18c96dd4595d202180d15c7c8cc0724bd757851ef5bb" |
| 12 | + sha256 cellar: :any_skip_relocation, sonoma: "f6e7c9b9c650e237f1175a092e93a57974444836f8352a20305a8b6665b873f5" |
| 13 | + end |
| 14 | + |
| 15 | + depends_on "go" => :build |
| 16 | + depends_on :macos |
| 17 | + |
| 18 | + def install |
| 19 | + ldflags = %W[ |
| 20 | + -s -w |
| 21 | + -X github.com/neilberkman/clippy/cmd/internal/common.Version=#{version} |
| 22 | + -X github.com/neilberkman/clippy/cmd/internal/common.Commit=#{tap.user} |
| 23 | + -X github.com/neilberkman/clippy/cmd/internal/common.Date=#{time.iso8601} |
| 24 | + ] |
| 25 | + system "go", "build", *std_go_args(ldflags:), "./cmd/clippy" |
| 26 | + system "go", "build", *std_go_args(ldflags:, output: bin/"pasty"), "./cmd/pasty" |
| 27 | + end |
| 28 | + |
| 29 | + test do |
| 30 | + assert_match version.to_s, shell_output("#{bin}/clippy --version") |
| 31 | + assert_match version.to_s, shell_output("#{bin}/pasty --version") |
| 32 | + |
| 33 | + (testpath/"test.txt").write("test content") |
| 34 | + system bin/"clippy", "-t", testpath/"test.txt" |
| 35 | + end |
| 36 | +end |
0 commit comments