aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2014-08-21 15:46:57 +0100
committerMike McQuaid2014-08-25 09:24:30 +0100
commit4db0aa19c1f5f8259de2e1436c2a476f04c2cb1e (patch)
tree22d7101a62dfa64da680b234da81fe4d87ba5150 /Library
parent8abc12296b1c56a1ee474915d600952ff6102f06 (diff)
downloadbrew-4db0aa19c1f5f8259de2e1436c2a476f04c2cb1e.tar.bz2
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>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/install.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index f0fd9f766..d0e65542e 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -24,24 +24,24 @@ module Homebrew
end
end unless ARGV.force?
- ARGV.formulae.each do |f|
- # Building head-only without --HEAD is an error
- if not ARGV.build_head? and f.stable.nil?
- raise CannotInstallFormulaError, <<-EOS.undent
- #{f} is a head-only formula
- Install with `brew install --HEAD #{f.name}`
- EOS
- end
+ begin
+ ARGV.formulae.each do |f|
+ # Building head-only without --HEAD is an error
+ if not ARGV.build_head? and f.stable.nil?
+ raise CannotInstallFormulaError, <<-EOS.undent
+ #{f} is a head-only formula
+ Install with `brew install --HEAD #{f.name}`
+ EOS
+ end
- # Building stable-only with --HEAD is an error
- if ARGV.build_head? and f.head.nil?
- raise CannotInstallFormulaError, "No head is defined for #{f.name}"
+ # Building stable-only with --HEAD is an error
+ if ARGV.build_head? and f.head.nil?
+ raise CannotInstallFormulaError, "No head is defined for #{f.name}"
+ end
end
- end
- perform_preinstall_checks
+ perform_preinstall_checks
- begin
ARGV.formulae.each { |f| install_formula(f) }
rescue FormulaUnavailableError => e
ofail e.message