# Homebrew formula for the Pyre CLI. Generated by cli/packaging/manifests.py
# for release 1.0.4; published to the tap repository by deploy-cli.sh.
class Pyre < Formula
  desc "Pyre command-line client: volumes, restore points, views, appliances, hubs"
  homepage "https://www.pyredata.io"
  version "1.0.4"
  license "Proprietary"
  # Homebrew validates the formula for every platform it knows, including
  # Linux arm64, and refuses to tap one that leaves a platform without a
  # URL. The top-level url is that fallback (there is no Linux arm64
  # build yet); the on_* blocks below pick the right archive elsewhere.
  url "https://www.pyredata.io/dl/cli/1.0.4/pyre_1.0.4_linux_amd64.tar.gz"
  sha256 "7b25270efcaa4bb07dbd83bee0c51353ec68ddf3732c253b80de500f1561a5df"

  on_macos do
    on_arm do
      url "https://www.pyredata.io/dl/cli/1.0.4/pyre_1.0.4_darwin_arm64.tar.gz"
      sha256 "dc8833bc431f6fe30c89c10d7dde1cbe6c397c6a39536703468e642d0d09baff"
    end
    on_intel do
      url "https://www.pyredata.io/dl/cli/1.0.4/pyre_1.0.4_darwin_amd64.tar.gz"
      sha256 "e07b0a7e2dff71d4b67127616895f5276f0612d2c48859bbfc563cf981738c65"
    end
  end
  on_linux do
    on_intel do
      url "https://www.pyredata.io/dl/cli/1.0.4/pyre_1.0.4_linux_amd64.tar.gz"
      sha256 "7b25270efcaa4bb07dbd83bee0c51353ec68ddf3732c253b80de500f1561a5df"
    end
  end

  def install
    bin.install "pyre"
    bash_completion.install "completions/pyre.bash" => "pyre"
    zsh_completion.install "completions/_pyre"
    fish_completion.install "completions/pyre.fish"
    man1.install Dir["man/*.1.gz"]
    doc.install "CHANGELOG.md", "README.txt"
  end

  test do
    assert_match "pyre 1.0.4", shell_output("#{bin}/pyre version")
  end
end
