rat icon indicating copy to clipboard operation
rat copied to clipboard

Add homebrew recipe

Open ericfreese opened this issue 8 years ago • 2 comments

Base on consul formula.

ericfreese avatar Feb 10 '17 15:02 ericfreese

$ brew audit --new-formula rat
rat:
  * GitHub repository not notable enough (<20 forks, <20 watchers and <50 stars)
  * GitHub repository too new (<30 days old)
Error: 2 problems in 1 formula

Have to wait a little while for this...

In the mean time, should be able to manually save the formula below to

$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/rat.rb

and run brew install rat.

class Rat < Formula
  desc "Compose shell commands to build terminal applications"
  homepage "https://github.com/ericfreese/rat"
  url "https://github.com/ericfreese/rat.git"
  version "0.0.2"
  sha256 "9da8d67a1e16056e3f05cdf536766e5571ede54a6c241c941d6c74eee5d64d31"

  depends_on "go" => :build

  def install
    contents = Dir["{*,.git,.gitignore}"]
    gopath = buildpath/"gopath"
    (gopath/"src/github.com/ericfreese/rat").install contents

    ENV["GOPATH"] = gopath

    cd gopath/"src/github.com/ericfreese/rat" do
      system "go", "build", "-o", "rat"
      bin.install "rat"
    end
  end

  test do
    system "[", "-x", "#{bin}/rat", "]"
  end
end

ericfreese avatar Feb 11 '17 01:02 ericfreese

PR submitted: https://github.com/Homebrew/homebrew-core/pull/19383

ericfreese avatar Oct 13 '17 00:10 ericfreese