diff options
| author | Jack Nagel | 2014-11-03 21:33:20 -0600 |
|---|---|---|
| committer | Jack Nagel | 2014-11-03 21:39:11 -0600 |
| commit | 3c9cc18c17d9558cca491253d0e4b7d8f04cd7c8 (patch) | |
| tree | aab21b838a386d7c744a953e92e79ec3876e02dc | |
| parent | 34c0b40abf0af354af4cb1a0e739c74d1b020b34 (diff) | |
| download | brew-3c9cc18c17d9558cca491253d0e4b7d8f04cd7c8.tar.bz2 | |
Add ARGV.git?
| -rw-r--r-- | Library/Homebrew/build.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/unpack.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 4 |
4 files changed, 8 insertions, 4 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 14209dd81..0a78f2326 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -115,7 +115,7 @@ class Build end formula.brew do - if ARGV.flag? '--git' + if ARGV.git? system "git", "init" system "git", "add", "-A" end @@ -124,7 +124,7 @@ class Build puts "Type `exit' to return and finalize the installation" puts "Install to this prefix: #{formula.prefix}" - if ARGV.flag? '--git' + if ARGV.git? puts "This directory is now a git repo. Make your changes and then use:" puts " git diff | pbcopy" puts "to copy the diff to the clipboard." diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 986ab6afc..14f6a2a12 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -125,7 +125,7 @@ module Homebrew fi.build_from_source = ARGV.build_from_source? fi.force_bottle = ARGV.force_bottle? fi.interactive = ARGV.interactive? - fi.interactive &&= :git if ARGV.flag? "--git" + fi.interactive &&= :git if ARGV.git? fi.verbose = ARGV.verbose? fi.verbose &&= :quieter if ARGV.quieter? fi.debug = ARGV.debug? diff --git a/Library/Homebrew/cmd/unpack.rb b/Library/Homebrew/cmd/unpack.rb index 9c71f8025..d33a9f9cc 100644 --- a/Library/Homebrew/cmd/unpack.rb +++ b/Library/Homebrew/cmd/unpack.rb @@ -36,7 +36,7 @@ module Homebrew f.brew { cp_r getwd, stage_dir } ENV['VERBOSE'] = nil - if ARGV.flag? "--git" + if ARGV.git? ohai "Setting up git repository" cd stage_dir system "git", "init", "-q" diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index dd695e4cb..669cb5d02 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -86,6 +86,10 @@ module HomebrewArgvExtension include?('--dry-run') || switch?('n') end + def git? + flag? "--git" + end + def homebrew_developer? include? '--homebrew-developer' or !ENV['HOMEBREW_DEVELOPER'].nil? end |
