install: immediately print FormulaUnavailableError.
This commit is contained in:
parent
e55f3a0cc5
commit
c458ffbd24
@ -206,44 +206,47 @@ module Homebrew
|
|||||||
# formula was found, but there's a problem with its implementation).
|
# formula was found, but there's a problem with its implementation).
|
||||||
ofail e.message
|
ofail e.message
|
||||||
rescue FormulaUnavailableError => e
|
rescue FormulaUnavailableError => e
|
||||||
if (reason = Homebrew::MissingFormula.reason(e.name))
|
if e.name == "updog"
|
||||||
ofail "#{e.message}\n#{reason}"
|
|
||||||
elsif e.name == "updog"
|
|
||||||
ofail "What's updog?"
|
ofail "What's updog?"
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
ofail e.message
|
||||||
|
if (reason = Homebrew::MissingFormula.reason(e.name))
|
||||||
|
$stderr.puts reason
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
query = query_regexp(e.name)
|
||||||
|
|
||||||
|
ohai "Searching for similarly named formulae..."
|
||||||
|
formulae_search_results = search_formulae(query)
|
||||||
|
case formulae_search_results.length
|
||||||
|
when 0
|
||||||
|
ofail "No similarly named formulae found."
|
||||||
|
when 1
|
||||||
|
puts "This similarly named formula was found:"
|
||||||
|
puts formulae_search_results
|
||||||
|
puts "To install it, run:\n brew install #{formulae_search_results.first}"
|
||||||
else
|
else
|
||||||
ofail e.message
|
puts "These similarly named formulae were found:"
|
||||||
|
puts Formatter.columns(formulae_search_results)
|
||||||
|
puts "To install one of them, run (for example):\n brew install #{formulae_search_results.first}"
|
||||||
|
end
|
||||||
|
|
||||||
query = query_regexp(e.name)
|
ohai "Searching taps..."
|
||||||
|
taps_search_results = search_taps(query)
|
||||||
ohai "Searching for similarly named formulae..."
|
case taps_search_results.length
|
||||||
formulae_search_results = search_formulae(query)
|
when 0
|
||||||
case formulae_search_results.length
|
ofail "No formulae found in taps."
|
||||||
when 0
|
when 1
|
||||||
ofail "No similarly named formulae found."
|
puts "This formula was found in a tap:"
|
||||||
when 1
|
puts taps_search_results
|
||||||
puts "This similarly named formula was found:"
|
puts "To install it, run:\n brew install #{taps_search_results.first}"
|
||||||
puts formulae_search_results
|
else
|
||||||
puts "To install it, run:\n brew install #{formulae_search_results.first}"
|
puts "These formulae were found in taps:"
|
||||||
else
|
puts Formatter.columns(taps_search_results)
|
||||||
puts "These similarly named formulae were found:"
|
puts "To install one of them, run (for example):\n brew install #{taps_search_results.first}"
|
||||||
puts Formatter.columns(formulae_search_results)
|
|
||||||
puts "To install one of them, run (for example):\n brew install #{formulae_search_results.first}"
|
|
||||||
end
|
|
||||||
|
|
||||||
ohai "Searching taps..."
|
|
||||||
taps_search_results = search_taps(query)
|
|
||||||
case taps_search_results.length
|
|
||||||
when 0
|
|
||||||
ofail "No formulae found in taps."
|
|
||||||
when 1
|
|
||||||
puts "This formula was found in a tap:"
|
|
||||||
puts taps_search_results
|
|
||||||
puts "To install it, run:\n brew install #{taps_search_results.first}"
|
|
||||||
else
|
|
||||||
puts "These formulae were found in taps:"
|
|
||||||
puts Formatter.columns(taps_search_results)
|
|
||||||
puts "To install one of them, run (for example):\n brew install #{taps_search_results.first}"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user