# Homebrew formula for the Pyre CLI. Generated by cli/packaging/manifests.py
# for release 1.0.17; 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.17"
  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.17/pyre_1.0.17_linux_amd64.tar.gz"
  sha256 "6490f18c565696ccd6f00bcac554f519ed1b668b288060e93628474e0949b97a"

  on_macos do
    on_arm do
      url "https://www.pyredata.io/dl/cli/1.0.17/pyre_1.0.17_darwin_arm64.tar.gz"
      sha256 "597f58fccd050e5ea2b641c3a8fbcd39ef18dc278c9aa13f0da5caedb2da8117"
    end
    on_intel do
      url "https://www.pyredata.io/dl/cli/1.0.17/pyre_1.0.17_darwin_amd64.tar.gz"
      sha256 "72619a977550ead990df2f58cdb807d0838ab13ac52f6075a986104dbfc6adf7"
    end
  end
  on_linux do
    on_intel do
      url "https://www.pyredata.io/dl/cli/1.0.17/pyre_1.0.17_linux_amd64.tar.gz"
      sha256 "6490f18c565696ccd6f00bcac554f519ed1b668b288060e93628474e0949b97a"
    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.17", shell_output("#{bin}/pyre version")
  end
end
