From acad6bb01c919b4e1b236a0718dd70242f6c0f01 Mon Sep 17 00:00:00 2001 From: ericchiang Date: Mon, 13 Oct 2014 11:25:35 -0400 Subject: [PATCH] brew formula added --- README.md | 12 ++++++++---- pup.rb | 18 ++++++++++++++++++ release.sh | 18 ++++++++++++++++++ 3 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 pup.rb diff --git a/README.md b/README.md index cfdc1c1..6701a96 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,16 @@ and join the hangout to discuss, pup, Go, and command-line tools. ## Install -Direct download are available on the [releases page]( -https://github.com/EricChiang/pup/releases). +If you don't have Go or aren't using OS X, directy downloads are available +through the [releases page](https://github.com/EricChiang/pup/releases). -Or if you can run `go get` to download via git. +If you have Go installed on your computer just run `go get`. - go get github.com/ericchiang/pup + go get github.com/ericchiang/pup + +If you're on OS X, use [Brew](http://brew.sh/) to install. + + brew install https://raw.githubusercontent.com/EricChiang/pup/master/pup.rb ## Quick start diff --git a/pup.rb b/pup.rb new file mode 100644 index 0000000..8514fa6 --- /dev/null +++ b/pup.rb @@ -0,0 +1,18 @@ +require 'formula' + +class Pup < Formula + homepage 'https://github.com/EricChiang/pup' + version '0.3.2' + + if Hardware.is_64_bit? + url 'https://github.com/EricChiang/pup/releases/download/v0.3.2/pup_darwin_amd64.zip' + sha1 '9d5ad4c0b78701b1868094bf630adbbd26ae1698' + else + url 'https://github.com/EricChiang/pup/releases/download/v0.3.2/pup_darwin_386.zip' + sha1 '21487bc5abdac34021f25444ab481e267bccbd72' + end + + def install + bin.install 'pup' + end +end diff --git a/release.sh b/release.sh index a2a4f85..13c1da1 100755 --- a/release.sh +++ b/release.sh @@ -1,3 +1,21 @@ #!/bin/bash +set -e + gox -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}" + +cd dist + +for file in `ls`; do + if [[ $file == *.exe ]] + then + mv $file pup.exe + file=${file%.exe} + zip $file pup.exe + rm pup.exe + else + mv $file pup + zip $file pup + rm pup + fi +done