Fix that reason is coerced to a boolean

f762033a57 introduced a bug such that `reason` is coerced to a boolean, so when displayed it loses information about the actual return value from `MissingFormula.reason`. This patch re-scopes the assignment of `reason` such that the actual reason is retained, while also retaining the sense of the new boolean check.
This commit is contained in:
David Rupp 2019-11-20 09:49:08 -05:00 committed by GitHub
parent a123d90e5d
commit 71fd680d51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,7 +103,7 @@ module Homebrew
if $stdout.tty?
count = all_formulae.count + all_casks.count
if reason = MissingFormula.reason(query, silent: true) && !local_casks.include?(query)
if (reason = MissingFormula.reason(query, silent: true)) && !local_casks.include?(query)
if count.positive?
puts
puts "If you meant #{query.inspect} specifically:"