add install option for zsh completion function

This commit is contained in:
Motonori Iwata 2011-10-20 18:00:35 +09:00
parent 496adeb23e
commit b6c1208eec
2 changed files with 17 additions and 4 deletions

View file

@ -36,6 +36,15 @@ If you're on a Mac and use [homebrew](http://github.com/mxcl/homebrew), it's sim
$ brew install https://github.com/iwata/git-now/raw/master/git-now.rb
#### install options
* use ``gnu-getopt``
$ brew install --gnu-getopt https://github.com/iwata/git-now/raw/master/git-now.rb
* copy zsh completion function to ``fpath``
$ brew install --zsh-completion https://github.com/iwata/git-now/raw/master/git-now.rb
### Manual installation
If you prefer a manual installation, please use the following instructions:

View file

@ -1,8 +1,8 @@
require 'formula'
class GitNow < Formula
url 'https://github.com/iwata/git-now.git', :tag => 'v0.1.0.3'
version '0.1.0.3'
url 'https://github.com/iwata/git-now.git', :tag => 'v0.1.0.4'
version '0.1.0.4'
head 'https://github.com/iwata/git-now.git', :branch => 'develop'
homepage 'https://github.com/iwata/git-now'
@ -11,15 +11,19 @@ class GitNow < Formula
end
# for longopt
if ARGV.include? '--ln-gnu-getopt'
if ARGV.include? '--gnu-getopt'
depends_on 'gnu-getopt'
end
def install
system "make", "prefix=#{prefix}", "install"
if ARGV.include? '--ln-gnu-getopt'
if ARGV.include? '--gnu-getopt'
system "brew ln gnu-getopt"
end
if ARGV.include? '--zsh-completion'
fpath = `echo $fpath |cut -d ' ' -f 1`
system "cp etc/_git-now #{fpath}"
end
end
end