From 71fd680d5180cc1ce6c78b784d99e4a84524b736 Mon Sep 17 00:00:00 2001 From: David Rupp Date: Wed, 20 Nov 2019 09:49:08 -0500 Subject: [PATCH] Fix that `reason` is coerced to a boolean https://github.com/Homebrew/brew/commit/f762033a57be271b778be6e39fe7d5b9d068ec64 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. --- Library/Homebrew/cmd/search.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 73861036ad..fee4468a2d 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -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:"