aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-10-05 21:47:26 +0100
committerMike McQuaid2017-10-05 21:47:26 +0100
commit4f8af059dfd0e73f23571747cc703bda29de9b8f (patch)
treea87dc674f1652485156fab27183fbb590b153ef7
parent57035b3ba4b8361c0e764575348607cc18b64ae7 (diff)
downloadbrew-4f8af059dfd0e73f23571747cc703bda29de9b8f.tar.bz2
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.
-rw-r--r--Library/Homebrew/os/mac.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb
index 15c301f99..853f75140 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