diff options
| author | Mike McQuaid | 2017-10-05 21:47:26 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2017-10-05 21:47:26 +0100 |
| commit | 4f8af059dfd0e73f23571747cc703bda29de9b8f (patch) | |
| tree | a87dc674f1652485156fab27183fbb590b153ef7 | |
| parent | 57035b3ba4b8361c0e764575348607cc18b64ae7 (diff) | |
| download | brew-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.rb | 4 |
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 |
