2015-09-28 03:51:58 +08:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class GottyClient < Formula
|
|
|
|
desc "gotty-client: GoTTY client for your terminal"
|
|
|
|
homepage "https://github.com/moul/gotty-client"
|
2017-01-19 12:46:18 +08:00
|
|
|
url "https://github.com/moul/gotty-client/archive/v1.6.1.tar.gz"
|
|
|
|
sha256 "322aba97334073eaac833f1b40ba83c7861ba32247d3160504cc78f64b5a2ef6"
|
2015-09-28 03:51:58 +08:00
|
|
|
|
|
|
|
head "https://github.com/moul/gotty-client.git"
|
|
|
|
|
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
2016-02-18 18:56:14 +08:00
|
|
|
ENV["GOBIN"] = buildpath
|
|
|
|
ENV["GO15VENDOREXPERIMENT"] = "1"
|
|
|
|
(buildpath/"src/github.com/moul/gotty-client").install Dir["*"]
|
2015-09-28 03:51:58 +08:00
|
|
|
|
2016-02-18 18:56:14 +08:00
|
|
|
system "go", "build", "-o", "#{bin}/gotty-client", "github.com/moul/gotty-client/cmd/gotty-client/"
|
2015-09-28 03:51:58 +08:00
|
|
|
|
2016-02-18 18:56:14 +08:00
|
|
|
bash_completion.install "#{buildpath}/src/github.com/moul/gotty-client/contrib/completion/bash_autocomplete"
|
|
|
|
zsh_completion.install "#{buildpath}/src/github.com/moul/gotty-client/contrib/completion/zsh_autocomplete"
|
2015-09-28 03:51:58 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-10-11 14:56:10 +08:00
|
|
|
output = shell_output(bin/"gotty-client --version")
|
|
|
|
assert output.include? "gotty-client version"
|
2015-09-28 03:51:58 +08:00
|
|
|
end
|
|
|
|
end
|