Do not throw when resolving a local engine if the .packages map does not include the flutter package (#5519)

This commit is contained in:
Jason Simmons
2016-08-19 14:40:14 -07:00
committed by GitHub
parent f434328a69
commit 789bfa4271

View File

@@ -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)