Use fs.identical to compare paths when finding the engine source path (#29386)

This will handle paths with symlinks that resolve to the same location.
This commit is contained in:
Jason Simmons
2019-03-15 09:32:10 -07:00
committed by GitHub
parent bd50007f16
commit e5696c2e7c
2 changed files with 6 additions and 1 deletions

View File

@@ -411,7 +411,7 @@ class FlutterCommandRunner extends CommandRunner<void> {
try {
Uri engineUri = PackageMap(PackageMap.globalPackagesPath).map[kFlutterEnginePackageName];
// Skip if sky_engine is the self-contained one.
if (fs.path.join(Cache.flutterRoot, 'bin', 'cache', 'pkg', kFlutterEnginePackageName, 'lib') + fs.path.separator == engineUri?.path) {
if (engineUri != null && fs.identicalSync(fs.path.join(Cache.flutterRoot, 'bin', 'cache', 'pkg', kFlutterEnginePackageName, 'lib'), engineUri.path)) {
engineUri = null;
}
// If sky_engine is specified and the engineSourcePath not set, try to determine the engineSourcePath by sky_engine setting.