Commit 646d7404 authored by Luke's avatar Luke Committed by Chris Bracken

Fix issues with flutter doctor (#7808)

* fix issue detecting ios-deploy. fix issue matching IntelliJ Ultimate on Mac

* refactor directory navigation code
parent f4603093
...@@ -386,11 +386,13 @@ class IntelliJValidatorOnMac extends IntelliJValidator { ...@@ -386,11 +386,13 @@ class IntelliJValidatorOnMac extends IntelliJValidator {
static final Map<String, String> _dirNameToId = <String, String>{ static final Map<String, String> _dirNameToId = <String, String>{
'IntelliJ IDEA.app' : 'IntelliJIdea', 'IntelliJ IDEA.app' : 'IntelliJIdea',
'IntelliJ IDEA Ultimate.app' : 'IntelliJIdea',
'IntelliJ IDEA CE.app' : 'IdeaIC', 'IntelliJ IDEA CE.app' : 'IdeaIC',
}; };
static Iterable<DoctorValidator> get installed { static Iterable<DoctorValidator> get installed {
List<DoctorValidator> validators = <DoctorValidator>[]; List<DoctorValidator> validators = <DoctorValidator>[];
List<String> installPaths = <String>['/Applications', path.join(homeDirPath, 'Applications')];
void checkForIntelliJ(Directory dir) { void checkForIntelliJ(Directory dir) {
String name = path.basename(dir.path); String name = path.basename(dir.path);
...@@ -403,13 +405,18 @@ class IntelliJValidatorOnMac extends IntelliJValidator { ...@@ -403,13 +405,18 @@ class IntelliJValidatorOnMac extends IntelliJValidator {
} }
try { try {
for (FileSystemEntity dir in fs.directory('/Applications').listSync()) { Iterable<FileSystemEntity> installDirs = installPaths
.map((String installPath) => fs.directory(installPath).listSync())
.expand((List<FileSystemEntity> mappedDirs) => mappedDirs)
.where((FileSystemEntity mappedDir) => mappedDir is Directory);
for (FileSystemEntity dir in installDirs) {
if (dir is Directory) { if (dir is Directory) {
checkForIntelliJ(dir); checkForIntelliJ(dir);
if (!dir.path.endsWith('.app')) { if (!dir.path.endsWith('.app')) {
for (FileSystemEntity subdir in dir.listSync()) { for (FileSystemEntity subdir in dir.listSync()) {
if (subdir is Directory) if (subdir is Directory) {
checkForIntelliJ(subdir); checkForIntelliJ(subdir);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment