# Homebrew formula for the Pyre CLI. Generated by cli/packaging/manifests.py
# for release 1.0.22; 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.22"
  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.22/pyre_1.0.22_linux_amd64.tar.gz"
  sha256 "ac8001c0b87650a1584ecc92f4b5a192bf6435148b9efe0bd62f1c4365aa658f"

  on_macos do
    on_arm do
      url "https://www.pyredata.io/dl/cli/1.0.22/pyre_1.0.22_darwin_arm64.tar.gz"
      sha256 "c9a5a4a798267a31aabb8cba1c27079c1042efa5e73be2feb96f05f367b51749"
    end
    on_intel do
      url "https://www.pyredata.io/dl/cli/1.0.22/pyre_1.0.22_darwin_amd64.tar.gz"
      sha256 "ac22cb905d0b5aba4b6a8a9000ceb6302704b445f05e952a749d8cbe4d54fb46"
    end
  end
  on_linux do
    on_intel do
      url "https://www.pyredata.io/dl/cli/1.0.22/pyre_1.0.22_linux_amd64.tar.gz"
      sha256 "ac8001c0b87650a1584ecc92f4b5a192bf6435148b9efe0bd62f1c4365aa658f"
    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.22", shell_output("#{bin}/pyre version")
  end
end
