53 lines
1.7 KiB
Ruby
53 lines
1.7 KiB
Ruby
require "language/go"
|
|
|
|
class Ghq < Formula
|
|
desc "Remote repository management made easy"
|
|
homepage "https://github.com/motemen/ghq"
|
|
url "https://github.com/motemen/ghq/archive/v0.8.0.tar.gz"
|
|
sha256 "e3df98794a423000676987812ded7dab30367dfbc82a2b7a8d2ebbea12fa81b2"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
rebuild 1
|
|
sha256 "f3b7bcd4d98836a3f67be418ec2a6edf2c8c772095180e0f1fb40a069383e435" => :mojave
|
|
sha256 "fc0268e02a7317756f6460d449abd37001f647d7ac0ced3689100a6d81d52605" => :high_sierra
|
|
sha256 "49b5d6f977404242bd93df665bcd45488017ae14f4ebaef47bc03da3bc62c765" => :sierra
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
|
|
go_resource "github.com/daviddengcn/go-colortext" do
|
|
url "https://github.com/daviddengcn/go-colortext.git",
|
|
:revision => "805cee6e0d43c72ba1d4e3275965ff41e0da068a"
|
|
end
|
|
|
|
go_resource "github.com/mitchellh/go-homedir" do
|
|
url "https://github.com/mitchellh/go-homedir.git",
|
|
:revision => "b8bc1bf767474819792c23f32d8286a45736f1c6"
|
|
end
|
|
|
|
go_resource "github.com/motemen/go-colorine" do
|
|
url "https://github.com/motemen/go-colorine.git",
|
|
:revision => "49ff36b8fa42db28092361cd20dcefd0b03b1472"
|
|
end
|
|
|
|
go_resource "github.com/urfave/cli" do
|
|
url "https://github.com/urfave/cli.git",
|
|
:revision => "f017f86fccc5a039a98f23311f34fdf78b014f78"
|
|
end
|
|
|
|
def install
|
|
mkdir_p buildpath/"src/github.com/motemen/"
|
|
ln_s buildpath, buildpath/"src/github.com/motemen/ghq"
|
|
ENV["GOPATH"] = buildpath
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
system "go", "build", "-ldflags", "-X main.Version=#{version}",
|
|
"-o", bin/"ghq"
|
|
zsh_completion.install "zsh/_ghq"
|
|
end
|
|
|
|
test do
|
|
assert_match "#{testpath}/.ghq", shell_output("#{bin}/ghq root")
|
|
end
|
|
end
|