From 4f8af059dfd0e73f23571747cc703bda29de9b8f Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 5 Oct 2017 21:47:26 +0100 Subject: [PATCH] os/mac: ignore apps found in Time Machine backups. These can introduce confusion on e.g. outdated Xcode versions when they are the only (or first) versions that are found. --- Library/Homebrew/os/mac.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 15c301f994..853f75140f 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -229,7 +229,9 @@ module OS end def app_with_bundle_id(*ids) - path = mdfind(*ids).first + path = mdfind(*ids) + .reject { |p| p.include?("/Backups.backupdb/") } + .first Pathname.new(path) unless path.nil? || path.empty? end