Commit 789bfa42 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Do not throw when resolving a local engine if the .packages map does not...

Do not throw when resolving a local engine if the .packages map does not include the flutter package (#5519)
parent f434328a
...@@ -189,10 +189,12 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -189,10 +189,12 @@ class FlutterCommandRunner extends CommandRunner {
if (engineSourcePath == null && globalResults['local-engine'] != null) { if (engineSourcePath == null && globalResults['local-engine'] != null) {
try { try {
Uri engineUri = new PackageMap(PackageMap.globalPackagesPath).map[kFlutterEnginePackageName]; Uri engineUri = new PackageMap(PackageMap.globalPackagesPath).map[kFlutterEnginePackageName];
engineSourcePath = path.dirname(path.dirname(path.dirname(path.dirname(engineUri.path)))); if (engineUri != null) {
bool dirExists = FileSystemEntity.isDirectorySync(path.join(engineSourcePath, 'out')); engineSourcePath = path.dirname(path.dirname(path.dirname(path.dirname(engineUri.path))));
if (engineSourcePath == '/' || engineSourcePath.isEmpty || !dirExists) bool dirExists = FileSystemEntity.isDirectorySync(path.join(engineSourcePath, 'out'));
engineSourcePath = null; if (engineSourcePath == '/' || engineSourcePath.isEmpty || !dirExists)
engineSourcePath = null;
}
} on FileSystemException { } on FormatException { } } on FileSystemException { } on FormatException { }
if (engineSourcePath == null) if (engineSourcePath == null)
......
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