mirror of
https://github.com/hanzoai/homebrew-tap.git
synced 2026-10-30 14:59:28 +00:00
51 lines
1.8 KiB
Ruby
51 lines
1.8 KiB
Ruby
class Hanzo < Formula
|
|
desc "AI coding agent and CLI for every Hanzo Cloud product"
|
|
homepage "https://github.com/hanzoai/cli"
|
|
version "8.5.890"
|
|
license "Apache-2.0"
|
|
|
|
on_macos do
|
|
on_arm do
|
|
url "https://github.com/hanzoai/cli/releases/download/v#{version}/hanzo-darwin-arm64.tar.gz"
|
|
sha256 "e1f7f94abd7b25938a1dc6bcefaf9ba03bd371622ad3c64a9ecd7d58d0cd8596"
|
|
end
|
|
on_intel do
|
|
url "https://github.com/hanzoai/cli/releases/download/v#{version}/hanzo-darwin-amd64.tar.gz"
|
|
sha256 "ab396f6bd5671c7d5fc9ecdcc76b2b02ad7116b66a0a3112b357a8cc71c586b3"
|
|
end
|
|
end
|
|
|
|
on_linux do
|
|
on_arm do
|
|
url "https://github.com/hanzoai/cli/releases/download/v#{version}/hanzo-linux-arm64.tar.gz"
|
|
sha256 "417b089e4da52f6868dd3e94813e9e71da34cfc93da1eda1ff88de1bf97814dc"
|
|
end
|
|
on_intel do
|
|
url "https://github.com/hanzoai/cli/releases/download/v#{version}/hanzo-linux-amd64.tar.gz"
|
|
sha256 "59558596bc103c240b27e0fe23f05678eba2b8273f742269bf0af8addf42efd3"
|
|
end
|
|
end
|
|
|
|
livecheck do
|
|
url :stable
|
|
strategy :github_latest
|
|
end
|
|
|
|
def install
|
|
bin.install "hanzo"
|
|
# `hanzo-node` is not a second program: it is the name hanzoai/cloud's Go
|
|
# control binary resolves FIRST when it delegates a verb it does not own
|
|
# (cloud/cli/link.go fabricCLI -> HANZO_FABRIC_CLI, hanzo-node, hanzo).
|
|
# A hanzo-node at a different version than hanzo is an invisible stale
|
|
# install: the user types `hanzo` and is silently handed an old build.
|
|
# A symlink cannot drift the way a second copy can.
|
|
bin.install_symlink bin/"hanzo" => "hanzo-node"
|
|
end
|
|
|
|
test do
|
|
expected = "hanzo #{version}"
|
|
assert_equal expected, shell_output("#{bin}/hanzo --version").strip
|
|
assert_equal expected, shell_output("#{bin}/hanzo-node --version").strip
|
|
end
|
|
end
|