2015-05-08 06:27:41 +00:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class Karn < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Manage multiple Git identities"
|
2015-05-08 06:27:41 +00:00
|
|
|
homepage "https://github.com/prydonius/karn"
|
2016-05-12 01:02:49 +00:00
|
|
|
url "https://github.com/prydonius/karn/archive/v0.0.3.tar.gz"
|
|
|
|
sha256 "a9336abe63dbf6b952e1e4a3d4c31ed62dda69aa51e53f07902edb894638162d"
|
2015-05-08 06:27:41 +00:00
|
|
|
|
2015-05-19 04:19:32 +00:00
|
|
|
bottle do
|
2016-04-09 11:08:36 +00:00
|
|
|
cellar :any_skip_relocation
|
2016-05-12 19:53:53 +00:00
|
|
|
sha256 "2f8c0c979d0f9adf7bb99b3fe84136af6c261445544f23fe7ed12d543a0e5485" => :el_capitan
|
|
|
|
sha256 "8ee7e6511ddfbcf8f5f7edc6f42bbbe6662e20e9ee029f7f2d13bb66e9fbf9e8" => :yosemite
|
|
|
|
sha256 "16d1efcf64c807f2db0a270fcff9b973eaf54c280af2819615fdaa46ff6cabc8" => :mavericks
|
2015-05-19 04:19:32 +00:00
|
|
|
end
|
|
|
|
|
2015-05-08 06:27:41 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
go_resource "github.com/codegangsta/cli" do
|
|
|
|
url "https://github.com/codegangsta/cli.git",
|
2016-05-12 19:25:03 +00:00
|
|
|
:revision => "f47f7b7e8568e846e9614acd5738092c3acf7058"
|
2015-05-08 06:27:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/mitchellh/go-homedir" do
|
|
|
|
url "https://github.com/mitchellh/go-homedir.git",
|
2016-05-12 19:25:03 +00:00
|
|
|
:revision => "7d2d8c8a4e078ce3c58736ab521a40b37a504c52"
|
2015-05-08 06:27:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "gopkg.in/yaml.v2" do
|
|
|
|
url "https://gopkg.in/yaml.v2",
|
|
|
|
:revision => "49c95bdc21843256fb6c4e0d370a05f24a0bf213", :using => :git
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
mkdir_p buildpath/"src/github.com/prydonius"
|
|
|
|
ln_s buildpath, buildpath/"src/github.com/prydonius/karn"
|
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
|
|
|
|
system "go", "build", "cmd/karn/karn.go"
|
|
|
|
bin.install "karn"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/".karn.yml").write <<-EOS.undent
|
|
|
|
---
|
|
|
|
#{testpath}:
|
|
|
|
name: Homebrew Test
|
|
|
|
email: test@brew.sh
|
|
|
|
EOS
|
|
|
|
system "git", "init"
|
|
|
|
system "git", "config", "--global", "user.name", "Test"
|
|
|
|
system "git", "config", "--global", "user.email", "test@test.com"
|
|
|
|
system "#{bin}/karn", "update"
|
|
|
|
end
|
|
|
|
end
|