From 28384787d106166ff8a1dc619e1f5b3d9a071088 Mon Sep 17 00:00:00 2001 From: Dan Rubel Date: Thu, 20 Oct 2016 12:01:29 -0400 Subject: [PATCH] search for IntelliJ on Mac in /Application and sub folders 1 level deep (#6419) --- packages/flutter_tools/lib/src/doctor.dart | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/flutter_tools/lib/src/doctor.dart b/packages/flutter_tools/lib/src/doctor.dart index 663f20755c..8fb3712a2c 100644 --- a/packages/flutter_tools/lib/src/doctor.dart +++ b/packages/flutter_tools/lib/src/doctor.dart @@ -430,15 +430,26 @@ class IntelliJValidatorOnMac extends IntelliJValidator { static Iterable get installed { List validators = []; + + void checkForIntelliJ(Directory dir) { + String name = path.basename(dir.path); + _dirNameToId.forEach((String dirName, String id) { + if (name == dirName) { + String title = IntelliJValidator._idToTitle[id]; + validators.add(new IntelliJValidatorOnMac(title, id, dir.path)); + } + }); + } + for (FileSystemEntity dir in new Directory('/Applications').listSync()) { if (dir is Directory) { - String name = path.basename(dir.path); - _dirNameToId.forEach((String dirName, String id) { - if (name == dirName) { - String title = IntelliJValidator._idToTitle[id]; - validators.add(new IntelliJValidatorOnMac(title, id, dir.path)); + checkForIntelliJ(dir); + if (!dir.path.endsWith('.app')) { + for (FileSystemEntity subdir in dir.listSync()) { + if (subdir is Directory) + checkForIntelliJ(subdir); } - }); + } } } return validators;