2015-06-03 05:50:10 +00:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class Ghq < Formula
|
|
|
|
desc "Remote repository management made easy"
|
|
|
|
homepage "https://github.com/motemen/ghq"
|
|
|
|
|
2016-07-01 03:20:17 +00:00
|
|
|
stable do
|
|
|
|
url "https://github.com/motemen/ghq/archive/v0.7.4.tar.gz"
|
|
|
|
sha256 "f6e79a7efec2cc11dd8489ae31619de85f15b588158d663256bc9fd45aca6a5d"
|
|
|
|
|
|
|
|
go_resource "github.com/codegangsta/cli" do
|
2016-07-01 03:24:39 +00:00
|
|
|
url "https://github.com/codegangsta/cli.git",
|
|
|
|
:revision => "aca5b047ed14d17224157c3434ea93bf6cdaadee"
|
2016-07-01 03:20:17 +00:00
|
|
|
end
|
|
|
|
end
|
2015-06-03 05:50:10 +00:00
|
|
|
|
2015-06-18 09:29:05 +00:00
|
|
|
bottle do
|
2015-12-16 04:20:47 +00:00
|
|
|
cellar :any_skip_relocation
|
2016-03-07 10:04:48 +00:00
|
|
|
sha256 "b54f10088af100659f5ddaa493ed0a67227a97996c476b2beb2e1f66109c4c96" => :el_capitan
|
|
|
|
sha256 "1640e26475d3ced7964f622de92b62f1eb216d36a880b512eb27f3655d607904" => :yosemite
|
|
|
|
sha256 "d87b3b0ab5a3a1f62d4ab34da198a20bb08abab16b21cdd98ef5c194220fb5de" => :mavericks
|
2015-06-18 09:29:05 +00:00
|
|
|
end
|
|
|
|
|
2016-07-01 03:20:17 +00:00
|
|
|
head do
|
|
|
|
url "https://github.com/motemen/ghq.git"
|
|
|
|
|
|
|
|
go_resource "github.com/codegangsta/cli" do
|
2016-07-01 03:24:39 +00:00
|
|
|
url "https://github.com/codegangsta/cli.git",
|
|
|
|
:revision => "1efa31f08b9333f1bd4882d61f9d668a70cd902e"
|
2016-07-01 03:20:17 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-06-03 05:50:10 +00:00
|
|
|
option "without-completions", "Disable zsh completions"
|
|
|
|
|
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
go_resource "github.com/mitchellh/go-homedir" do
|
2016-07-01 03:24:39 +00:00
|
|
|
url "https://github.com/mitchellh/go-homedir.git",
|
|
|
|
:revision => "981ab348d865cf048eb7d17e78ac7192632d8415"
|
2015-06-03 05:50:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/motemen/go-colorine" do
|
2016-07-01 03:24:39 +00:00
|
|
|
url "https://github.com/motemen/go-colorine.git",
|
|
|
|
:revision => "49ff36b8fa42db28092361cd20dcefd0b03b1472"
|
2015-06-03 05:50:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/daviddengcn/go-colortext" do
|
2016-07-01 03:24:39 +00:00
|
|
|
url "https://github.com/daviddengcn/go-colortext.git",
|
|
|
|
:revision => "3b18c8575a432453d41fdafb340099fff5bba2f7"
|
2015-06-03 05:50:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
mkdir_p "#{buildpath}/src/github.com/motemen/"
|
|
|
|
ln_s buildpath, "#{buildpath}/src/github.com/motemen/ghq"
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
ENV.append_path "PATH", "#{ENV["GOPATH"]}/bin"
|
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
|
2015-08-04 05:12:33 +00:00
|
|
|
system "go", "build", "-ldflags", "-X main.Version #{version}", "-o", "ghq"
|
2015-06-03 05:50:10 +00:00
|
|
|
bin.install "ghq"
|
2016-07-01 03:24:39 +00:00
|
|
|
zsh_completion.install "zsh/_ghq" if build.with? "completions"
|
2015-06-03 05:50:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
assert_match "#{testpath}/.ghq", shell_output("#{bin}/ghq root")
|
|
|
|
end
|
|
|
|
end
|