# Homebrew formula for the Pyre CLI. Generated by cli/packaging/manifests.py
# for release 1.0.20; 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.20"
  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.20/pyre_1.0.20_linux_amd64.tar.gz"
  sha256 "0e71b9e1c275687dbadccecbd4fb57b34f3f12f4768c5105f8add77fe61eb9ae"

  on_macos do
    on_arm do
      url "https://www.pyredata.io/dl/cli/1.0.20/pyre_1.0.20_darwin_arm64.tar.gz"
      sha256 "a981a15698a77df9190c87a79c917c4d2b2ffa55d7fb0ce85c9906470f353239"
    end
    on_intel do
      url "https://www.pyredata.io/dl/cli/1.0.20/pyre_1.0.20_darwin_amd64.tar.gz"
      sha256 "c5bb81b5f307aba0bb1b5e381228d28b3ef79fe0caf4b2a7af02a1c8fe81440b"
    end
  end
  on_linux do
    on_intel do
      url "https://www.pyredata.io/dl/cli/1.0.20/pyre_1.0.20_linux_amd64.tar.gz"
      sha256 "0e71b9e1c275687dbadccecbd4fb57b34f3f12f4768c5105f8add77fe61eb9ae"
    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.20", shell_output("#{bin}/pyre version")
  end
end
