43 lines
1.5 KiB
Ruby
43 lines
1.5 KiB
Ruby
class Mmctl < Formula
|
|
desc "Remote CLI tool for Mattermost server"
|
|
homepage "https://github.com/mattermost/mmctl"
|
|
url "https://github.com/mattermost/mmctl.git",
|
|
tag: "v5.27.0",
|
|
revision: "1dc9cda2e80757ff8fc694f32efc7ea76e327635"
|
|
license "Apache-2.0"
|
|
head "https://github.com/mattermost/mmctl.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "c6487e68fdd7c307affcefb22559d490f91d872c42c9603126abbba7abbd64df" => :catalina
|
|
sha256 "f657c4416f8cebc8f3491f422d64637181b20fab332bf43bb15771fc78e4a77d" => :mojave
|
|
sha256 "81083c3540155a6f3413b83f24ec46eab80081a9e1f84b9d9243b0419e66217e" => :high_sierra
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
|
|
def install
|
|
ENV["GOBIN"] = buildpath/bin
|
|
ENV["ADVANCED_VET"] = "FALSE"
|
|
ENV["BUILD_HASH"] = Utils.safe_popen_read("git", "rev-parse", "HEAD").chomp
|
|
ENV["BUILD_VERSION"] = version.to_s
|
|
(buildpath/"src/github.com/mattermost/mmctl").install buildpath.children
|
|
cd "src/github.com/mattermost/mmctl" do
|
|
system "make", "install"
|
|
|
|
# Install the zsh and bash completions
|
|
output = Utils.safe_popen_read("#{bin}/mmctl", "completion", "bash")
|
|
(bash_completion/"mmctl").write output
|
|
output = Utils.safe_popen_read("#{bin}/mmctl", "completion", "zsh")
|
|
(zsh_completion/"_mmctl").write output
|
|
end
|
|
end
|
|
|
|
test do
|
|
output = pipe_output("#{bin}/mmctl help 2>&1")
|
|
assert_no_match /.*No such file or directory.*/, output
|
|
assert_no_match /.*command not found.*/, output
|
|
assert_match /.*mmctl \[command\].*/, output
|
|
end
|
|
end
|