aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-01-09 21:30:41 +0000
committerMike McQuaid2017-01-09 21:10:55 -0800
commit4a39070c268b6dba063b938d8663c70f60311230 (patch)
tree17070cad52831c06292972ec6d55006ba26244d8
parent9cce3414fbd39d146d97911dbb3bf07fffaa1080 (diff)
downloadbrew-4a39070c268b6dba063b938d8663c70f60311230.tar.bz2
xquartz: use default location when possible.
Xcode can be installed anywhere but for most people it's in `/Applications/Xcode.app` so just look there by default before looking at Spotlight which can return weird results on e.g. backup disks.
-rw-r--r--Library/Homebrew/os/mac/xquartz.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb
index 674e50c50..b82772faf 100644
--- a/Library/Homebrew/os/mac/xquartz.rb
+++ b/Library/Homebrew/os/mac/xquartz.rb
@@ -5,6 +5,8 @@ module OS
module XQuartz
module_function
+ # TODO: confirm this path when you have internet
+ DEFAULT_BUNDLE_PATH = Pathname.new("Applications/Utilities/XQuartz.app").freeze
FORGE_BUNDLE_ID = "org.macosforge.xquartz.X11".freeze
APPLE_BUNDLE_ID = "org.x.X11".freeze
FORGE_PKG_ID = "org.macosforge.xquartz.pkg".freeze
@@ -56,6 +58,11 @@ module OS
end
def bundle_path
+ # Use the default location if it exists.
+ return DEFAULT_BUNDLE_PATH if DEFAULT_BUNDLE_PATH.exist?
+
+ # Ask Spotlight where XQuartz is. If the user didn't install XQuartz
+ # in the conventional place, this is our only option.
MacOS.app_with_bundle_id(FORGE_BUNDLE_ID, APPLE_BUNDLE_ID)
end