Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active January 4, 2023 22:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save miguelmota/33489af6d1655188869f3698020354c3 to your computer and use it in GitHub Desktop.
Save miguelmota/33489af6d1655188869f3698020354c3 to your computer and use it in GitHub Desktop.
Homebrew golang formula example
require "language/go"
class Cointop < Formula
desc "An interactive terminal based UI application for tracking cryptocurrencies"
homepage "https://cointop.sh"
url "https://github.com/miguelmota/cointop/archive/0.0.1.tar.gz"
sha256 "3b2b039da68c92d597ae4a6a89aab58d9741132efd514bbf5cf1a1a151b16213"
revision 1
head "https://github.com/miguelmota/cointop.git"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
path = buildpath/"src/github.com/miguelmota/cointop"
system "go", "get", "-u", "github.com/miguelmota/cointop"
cd path do
system "go", "build", "-o", "#{bin}/cointop"
end
end
test do
system "true"
end
end 
require "language/go"
class Cointop < Formula
desc "An interactive terminal based UI application for tracking cryptocurrencies"
homepage "https://cointop.sh"
url "https://github.com/miguelmota/cointop/archive/0.0.1.tar.gz"
sha256 "3b2b039da68c92d597ae4a6a89aab58d9741132efd514bbf5cf1a1a151b16213"
revision 1
head "https://github.com/miguelmota/cointop.git"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
path = buildpath/"src/github.com/miguelmota/cointop"
path.install Dir["*"]
cd path do
system "go", "build", "-o", "#{bin}/cointop"
end
end
test do
assert_match version.to_s, shell_output("#{bin}/cointop", "-v")
end
end 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment