Do not throw when resolving a local engine if the .packages map does not include the flutter package (#5519)
This commit is contained in:
@@ -189,10 +189,12 @@ class FlutterCommandRunner extends CommandRunner {
|
||||
if (engineSourcePath == null && globalResults['local-engine'] != null) {
|
||||
try {
|
||||
Uri engineUri = new PackageMap(PackageMap.globalPackagesPath).map[kFlutterEnginePackageName];
|
||||
engineSourcePath = path.dirname(path.dirname(path.dirname(path.dirname(engineUri.path))));
|
||||
bool dirExists = FileSystemEntity.isDirectorySync(path.join(engineSourcePath, 'out'));
|
||||
if (engineSourcePath == '/' || engineSourcePath.isEmpty || !dirExists)
|
||||
engineSourcePath = null;
|
||||
if (engineUri != null) {
|
||||
engineSourcePath = path.dirname(path.dirname(path.dirname(path.dirname(engineUri.path))));
|
||||
bool dirExists = FileSystemEntity.isDirectorySync(path.join(engineSourcePath, 'out'));
|
||||
if (engineSourcePath == '/' || engineSourcePath.isEmpty || !dirExists)
|
||||
engineSourcePath = null;
|
||||
}
|
||||
} on FileSystemException { } on FormatException { }
|
||||
|
||||
if (engineSourcePath == null)
|
||||
|
||||
Reference in New Issue
Block a user