Add --git option to 'brew install -i'.

This allows for easy generation of diffs, per a trick in
http://wiki.github.com/mxcl/homebrew/formula-cookbook
This commit is contained in:
Adam Vandenberg 2010-04-07 16:45:31 -07:00
parent 0f7b3bd408
commit 54b5a7afbb

View File

@ -78,6 +78,15 @@ def install f
ohai "Entering interactive mode" ohai "Entering interactive mode"
puts "Type `exit' to return and finalize the installation" puts "Type `exit' to return and finalize the installation"
puts "Install to this prefix: #{f.prefix}" puts "Install to this prefix: #{f.prefix}"
if ARGV.flag? '--git'
system "git init"
system "git add -A"
puts "This folder is now a git repo. Make your changes and then use:"
puts " git diff | pbcopy"
puts "to copy the diff to the clipboard."
end
interactive_shell interactive_shell
nil nil
elsif ARGV.include? '--help' elsif ARGV.include? '--help'