install: search when formula isn't found.

If you do `brew install blah` it currently doesn't search for it. This
seems to be unintentional looking at this code as the exception thrown
by ARGV.formulae.each is not caught and handled. Instead, let's handle
this case and provide a little more usability around our taps.

Closes Homebrew/homebrew#31761.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2014-08-21 15:46:57 +01:00
parent 8abc12296b
commit 4db0aa19c1

View File

@ -24,6 +24,7 @@ module Homebrew
end end
end unless ARGV.force? end unless ARGV.force?
begin
ARGV.formulae.each do |f| ARGV.formulae.each do |f|
# Building head-only without --HEAD is an error # Building head-only without --HEAD is an error
if not ARGV.build_head? and f.stable.nil? if not ARGV.build_head? and f.stable.nil?
@ -41,7 +42,6 @@ module Homebrew
perform_preinstall_checks perform_preinstall_checks
begin
ARGV.formulae.each { |f| install_formula(f) } ARGV.formulae.each { |f| install_formula(f) }
rescue FormulaUnavailableError => e rescue FormulaUnavailableError => e
ofail e.message ofail e.message