From 09fec4c51b3acd13f2cfa263f78b8be6bc5671ce Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Mon, 20 Aug 2018 09:45:18 -0700 Subject: [PATCH] Canonicalize path depdendencies in `flutter update-packages` The tool was failing if we had 2 separate non-canonical paths to the same canonical paths. --- packages/flutter_tools/lib/src/commands/update_packages.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index 6755ff0a494..6f19cc2d218 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -991,7 +991,9 @@ class PubspecDependency extends PubspecLine { assert(kind == DependencyKind.unknown); if (line.startsWith(_pathPrefix)) { // We're a path dependency; remember the (absolute) path. - _lockTarget = fs.path.absolute(fs.path.dirname(pubspecPath), line.substring(_pathPrefix.length, line.length)); + _lockTarget = fs.path.canonicalize( + fs.path.absolute(fs.path.dirname(pubspecPath), line.substring(_pathPrefix.length, line.length)) + ); _kind = DependencyKind.path; } else if (line.startsWith(_sdkPrefix)) { // We're an SDK dependency.