# Homebrew formula for the Pyre CLI. Generated by cli/packaging/manifests.py
# for release 1.0.30; 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.30"
  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.30/pyre_1.0.30_linux_amd64.tar.gz"
  sha256 "69dd7afc683c6589704a1add1828ce2e2f81bbf3aa12f57234e734d279f9c84c"

  on_macos do
    on_arm do
      url "https://www.pyredata.io/dl/cli/1.0.30/pyre_1.0.30_darwin_arm64.tar.gz"
      sha256 "32ba00de3cf7f0b09677d3c7526c86015ffbbfc9d5d3ed7c2ff4f504be6affb9"
    end
    on_intel do
      url "https://www.pyredata.io/dl/cli/1.0.30/pyre_1.0.30_darwin_amd64.tar.gz"
      sha256 "5e95568c6cfa6b6636e8a1bed349c8b976fbfa1b0d8e977412227fd3b912eb5a"
    end
  end
  on_linux do
    on_intel do
      url "https://www.pyredata.io/dl/cli/1.0.30/pyre_1.0.30_linux_amd64.tar.gz"
      sha256 "69dd7afc683c6589704a1add1828ce2e2f81bbf3aa12f57234e734d279f9c84c"
    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.30", shell_output("#{bin}/pyre version")
  end
end
