From b6c1208eecab10568d57d22b93629ae37ecf51fa Mon Sep 17 00:00:00 2001 From: Motonori Iwata Date: Thu, 20 Oct 2011 18:00:35 +0900 Subject: [PATCH] add install option for zsh completion function --- README.mdown | 9 +++++++++ git-now.rb | 12 ++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.mdown b/README.mdown index 41e5880..5e41d75 100644 --- a/README.mdown +++ b/README.mdown @@ -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: diff --git a/git-now.rb b/git-now.rb index 34a3a38..7ef4499 100644 --- a/git-now.rb +++ b/git-now.rb @@ -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