Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions Formula/mmctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ 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.36.0",
revision: "a3c6ff14a9f44dc847fa629a9e8ab516b8b883ec"
tag: "v5.38.0",
revision: "cf832fbc44c2b36afde8bf1c01ff72f877cea79d"
license "Apache-2.0"
head "https://github.com/mattermost/mmctl.git"
head "https://github.com/mattermost/mmctl.git", branch: "master"

livecheck do
url :stable
Expand All @@ -23,20 +23,14 @@ class Mmctl < Formula
depends_on "go" => :build

def install
ENV["GOBIN"] = buildpath/bin
ENV["ADVANCED_VET"] = "FALSE"
ENV["BUILD_HASH"] = Utils.git_head
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"
ldflags = "-s -w -X github.com/mattermost/mmctl/commands.BuildHash=#{Utils.git_head}"
system "go", "build", *std_go_args(ldflags: ldflags), "-mod=vendor"
Comment on lines +26 to +27
Copy link
Copy Markdown
Member Author

@branchv branchv Aug 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in addition to removing make's indirection, this avoids failing on gofmt errors with go 1.17

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


# 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
# Install shell 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

test do
Expand Down