aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-11-03 21:33:20 -0600
committerJack Nagel2014-11-03 21:39:11 -0600
commitb5b8861d7a126b5dee3f98e4ad13f164eb344e1a (patch)
tree904e4699598cdd9f0a52bf0624065eaa83926cc7
parent80e48ad27c2ae1baa67f177bece989a6ef92bf6e (diff)
downloadhomebrew-b5b8861d7a126b5dee3f98e4ad13f164eb344e1a.tar.bz2
Add ARGV.git?
-rw-r--r--Library/Homebrew/build.rb4
-rw-r--r--Library/Homebrew/cmd/install.rb2
-rw-r--r--Library/Homebrew/cmd/unpack.rb2
-rw-r--r--Library/Homebrew/extend/ARGV.rb4
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