Only allow --interactive with one formula argument
See comments in commit for details.
This commit is contained in:
parent
fdaa267fb9
commit
a793e30405
@ -66,6 +66,9 @@ module HomebrewArgvExtension
|
||||
def quieter?
|
||||
flag? '--quieter'
|
||||
end
|
||||
def interactive?
|
||||
flag? '--interactive'
|
||||
end
|
||||
|
||||
def flag? flag
|
||||
options.each do |arg|
|
||||
|
||||
@ -174,7 +174,7 @@ end
|
||||
|
||||
def install f
|
||||
f.brew do
|
||||
if ARGV.flag? '--interactive'
|
||||
if ARGV.interactive?
|
||||
ohai "Entering interactive mode"
|
||||
puts "Type `exit' to return and finalize the installation"
|
||||
puts "Install to this prefix: #{f.prefix}"
|
||||
|
||||
9
bin/brew
9
bin/brew
@ -91,6 +91,15 @@ begin
|
||||
end
|
||||
end
|
||||
|
||||
if ARGV.interactive? and ARGV.formulae.count > 1
|
||||
# the reason for this is interactive mode is a little tricky to do
|
||||
# with more than one formula, AND I can't think of a time where you'd
|
||||
# want to do it anyway. If someone comes up with a legitimate use for
|
||||
# this we will adapt the code. "But I might want it!" is not a
|
||||
# legitimate use!
|
||||
raise "Interactive mode can only be used with one formula argument"
|
||||
end
|
||||
|
||||
unless ARGV.force?
|
||||
unless system "which #{ENV['CC'] or 'cc'} &> /dev/null" and $?.success?
|
||||
raise "We cannot find a c compiler, have you installed the latest Xcode?"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user