Files
dingtalk-workspace-cli/Formula/dingtalk-workspace-cli-beta.rb
T

64 lines
2.3 KiB
Ruby

class DingtalkWorkspaceCliBeta < Formula
desc "Automate DingTalk workspace tasks from the terminal (beta channel)"
homepage "https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli"
version "1.0.53-beta.6"
license "Apache-2.0"
keg_only "it is the beta channel and conflicts with dingtalk-workspace-cli"
on_macos do
if Hardware::CPU.arm?
url "https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli/releases/download/v1.0.53-beta.6/dws-darwin-arm64.tar.gz"
sha256 "250f072f6823a56af0e6cfac745f967f2c454d83996e1ace71588505f501091b"
else
url "https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli/releases/download/v1.0.53-beta.6/dws-darwin-amd64.tar.gz"
sha256 "b5289fae7ab2ab39699efa0e2ae79f30aa24c063f490f5a6b29eb9c98026d504"
end
end
on_linux do
if Hardware::CPU.arm?
url "https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli/releases/download/v1.0.53-beta.6/dws-linux-arm64.tar.gz"
sha256 "0bbc262859ddea5bbd360ed052a68f6123bec37e1264810d514103a56a1f20b0"
else
url "https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli/releases/download/v1.0.53-beta.6/dws-linux-amd64.tar.gz"
sha256 "5bfbf18454775cb7cd26ec4673726e21a78fe7334c929b4eaade516dd4755bab"
end
end
resource "skills" do
url "https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli/releases/download/v1.0.53-beta.6/dws-skills.zip"
sha256 "a8894a7106728f59240eb698d5d4f0f069deba57898566e54845657b2ffceacf"
end
def install
root = Dir["dws-*"].find { |entry| File.directory?(entry) } || "."
binary = File.join(root, "dws")
raise "binary not found: #{binary}" unless File.exist?(binary)
bin.install binary => "dws"
%w[LICENSE NOTICE README.md CHANGELOG.md].each do |name|
source = File.join(root, name)
pkgshare.install source if File.exist?(source)
end
skill_dest = pkgshare/"skills/dws"
skill_dest.mkpath
resource("skills").stage do
cp_r(Dir["*"], skill_dest)
end
end
def caveats
<<~EOS
Agent Skills are bundled in #{pkgshare}/skills/dws.
Run `dws skill setup` to install them into your Agent directories.
This beta is keg-only. Add #{opt_bin} to PATH to use its `dws` binary.
EOS
end
test do
assert_match version.to_s, shell_output("#{bin}/dws version")
end
end