From 646d7404cb82fa95901d78775db316be354afee5 Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 2 Feb 2017 00:19:10 -0800 Subject: [PATCH] Fix issues with flutter doctor (#7808) * fix issue detecting ios-deploy. fix issue matching IntelliJ Ultimate on Mac * refactor directory navigation code --- packages/flutter_tools/lib/src/doctor.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/lib/src/doctor.dart b/packages/flutter_tools/lib/src/doctor.dart index 6bac38f86c..4e7b1c16dd 100644 --- a/packages/flutter_tools/lib/src/doctor.dart +++ b/packages/flutter_tools/lib/src/doctor.dart @@ -386,11 +386,13 @@ class IntelliJValidatorOnMac extends IntelliJValidator { static final Map _dirNameToId = { 'IntelliJ IDEA.app' : 'IntelliJIdea', + 'IntelliJ IDEA Ultimate.app' : 'IntelliJIdea', 'IntelliJ IDEA CE.app' : 'IdeaIC', }; static Iterable get installed { List validators = []; + List installPaths = ['/Applications', path.join(homeDirPath, 'Applications')]; void checkForIntelliJ(Directory dir) { String name = path.basename(dir.path); @@ -403,13 +405,18 @@ class IntelliJValidatorOnMac extends IntelliJValidator { } try { - for (FileSystemEntity dir in fs.directory('/Applications').listSync()) { + Iterable installDirs = installPaths + .map((String installPath) => fs.directory(installPath).listSync()) + .expand((List mappedDirs) => mappedDirs) + .where((FileSystemEntity mappedDir) => mappedDir is Directory); + for (FileSystemEntity dir in installDirs) { if (dir is Directory) { checkForIntelliJ(dir); if (!dir.path.endsWith('.app')) { for (FileSystemEntity subdir in dir.listSync()) { - if (subdir is Directory) + if (subdir is Directory) { checkForIntelliJ(subdir); + } } } }