From 5d5127b690614e22da6c26cdf3ba6e4ab283c0f6 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 27 Jun 2018 09:28:27 +0800 Subject: [PATCH] feat: support install from homebrew (#360) * feat: support install from homebrew * docs: add readme. --- HomebrewFormula/gorush.rb | 17 +++++++++++++++++ README.md | 6 ++++++ 2 files changed, 23 insertions(+) create mode 100644 HomebrewFormula/gorush.rb diff --git a/HomebrewFormula/gorush.rb b/HomebrewFormula/gorush.rb new file mode 100644 index 0000000..5c67996 --- /dev/null +++ b/HomebrewFormula/gorush.rb @@ -0,0 +1,17 @@ +class Gorush < Formula + desc "A push notification server written in Go (Golang)." + homepage "https://github.com/appleboy/gorush" + head "https://github.com/appleboy/gorush.git" + + depends_on "go" => :build + + def install + ENV["GOPATH"] = buildpath + gorushpath = buildpath/"src/github.com/appleboy/gorush" + gorushpath.install buildpath.children + cd gorushpath do + system "go", "build", "-o", bin/"gorush" + prefix.install_metafiles + end + end +end diff --git a/README.md b/README.md index 8f1d222..418147b 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,12 @@ On Windows $ wget https://github.com/appleboy/gorush/releases/download/1.10.0/gorush-1.10.0-windows-amd64.exe -O gorush.exe ``` +On macOS, use Homebrew. + +``` +$ brew install --HEAD https://github.com/appleboy/gorush/raw/master/HomebrewFormula/gorush.rb +``` + ### Command Usage ```