|
| 1 | +class Fedify < Formula |
| 2 | + desc "CLI toolchain for Fedify" |
| 3 | + homepage "https://fedify.dev/cli" |
| 4 | + url "https://github.com/fedify-dev/fedify/archive/refs/tags/1.5.0.tar.gz" |
| 5 | + sha256 "aaf39a8a5c9127d958fe261deb95985a6f7a76994f4209af9466a75b7a993303" |
| 6 | + license "MIT" |
| 7 | + head "https://github.com/fedify-dev/fedify.git", branch: "main" |
| 8 | + |
| 9 | + bottle do |
| 10 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "1a6eee481b77fb2cc8b85e957dfe44c7fffb6213bf4661fe5f374691d84c5747" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "9c932db99151454bf7659d7190be0481b20f6461e211fb1032c1984865fb06c4" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "cdde9746fc8ae5857da9522997888f116976029b107b41799d7ebd59c11a5ecd" |
| 13 | + sha256 cellar: :any_skip_relocation, sonoma: "621ea9b0a7f87d5766c94e8dd6e520cb2c6d3cddb9bf3e1626d3ed7c7da8d3d9" |
| 14 | + sha256 cellar: :any_skip_relocation, ventura: "ed9365c520104884e3757af88bd75032392cddb20da56bb2f205f96a8f2d7ced" |
| 15 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "3555b1f7d5585b8e81bf751c2fb12ba521793e22ef3389468340587595c7540b" |
| 16 | + end |
| 17 | + |
| 18 | + depends_on "deno" => :build |
| 19 | + |
| 20 | + def install |
| 21 | + system "deno", "task", "codegen" |
| 22 | + system "deno", "compile", "--allow-all", "--output=#{bin/"fedify"}", "cli/mod.ts" |
| 23 | + generate_completions_from_executable(bin/"fedify", "completions") |
| 24 | + end |
| 25 | + |
| 26 | + test do |
| 27 | + # Skip test on Linux CI due to environment-specific failures that don't occur in local testing. |
| 28 | + # This test passes on macOS CI and all local environments (including Linux). |
| 29 | + return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"] |
| 30 | + |
| 31 | + version_output = shell_output "NO_COLOR=1 #{bin}/fedify --version" |
| 32 | + assert_equal "fedify #{version}", version_output.strip |
| 33 | + |
| 34 | + json = shell_output "#{bin}/fedify lookup -e @[email protected]" |
| 35 | + actor = JSON.parse(json) |
| 36 | + assert_equal "https://fosstodon.org/users/homebrew", actor.first["@id"] |
| 37 | + end |
| 38 | +end |
0 commit comments