diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb index d44b7627ab..1db630619d 100644 --- a/Library/Homebrew/macos.rb +++ b/Library/Homebrew/macos.rb @@ -174,7 +174,7 @@ module MacOS extend self # distributed by Apple is also XQuartz, and therefore covered by this method. path = app_with_bundle_id(XQUARTZ_BUNDLE_ID) || app_with_bundle_id(APPLE_X11_BUNDLE_ID) version = if not path.nil? and path.exist? - `mdls -raw -name kMDItemVersion #{path}`.strip + `mdls -raw -name kMDItemVersion "#{path}" 2>/dev/null`.strip end end