diff options
| -rw-r--r-- | Library/Homebrew/os/mac/xquartz.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb index a836abcbc..b4fd1ece7 100644 --- a/Library/Homebrew/os/mac/xquartz.rb +++ b/Library/Homebrew/os/mac/xquartz.rb @@ -8,7 +8,7 @@ module MacOS::XQuartz extend self # by this method. def version @version ||= begin - path = MacOS.app_with_bundle_id(FORGE_BUNDLE_ID) || MacOS.app_with_bundle_id(APPLE_BUNDLE_ID) + path = bundle_path if not path.nil? and path.exist? `mdls -raw -name kMDItemVersion "#{path}" 2>/dev/null`.strip elsif prefix.to_s == "/usr/X11" @@ -33,6 +33,10 @@ module MacOS::XQuartz extend self "2.7.4" end + def bundle_path + MacOS.app_with_bundle_id(FORGE_BUNDLE_ID) || MacOS.app_with_bundle_id(APPLE_BUNDLE_ID) + end + def provided_by_apple? [FORGE_BUNDLE_ID, APPLE_BUNDLE_ID].find do |id| MacOS.app_with_bundle_id(id) |
