Method: XcodeInstall::Installer#installed

Defined in:
lib/xcode/install.rb

#installedObject (private)



408
409
410
411
412
413
414
415
416
# File 'lib/xcode/install.rb', line 408

def installed
  result = `mdfind "kMDItemCFBundleIdentifier == 'com.apple.dt.Xcode'" 2>/dev/null`.split("\n")
  if result.empty?
    result = `find /Applications -maxdepth 1 -name '*.app' -type d -exec sh -c \
    'if [ "$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" \
    "{}/Contents/Info.plist" 2>/dev/null)" == "com.apple.dt.Xcode" ]; then echo "{}"; fi' ';'`.split("\n")
  end
  result
end