Skip to content

Commit 184bbd3

Browse files
committed
Fix issue with not normalizing path of dependency before compare and copy
1 parent 9f3d730 commit 184bbd3

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

dwds/test/fixtures/project.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,22 +199,23 @@ class TestProject {
199199
final pubspec = Pubspec.parse(
200200
File(p.join(currentPath, 'pubspec.yaml')).readAsStringSync(),
201201
);
202-
for (final package in pubspec.dependencies.keys) {
203-
final dependency = pubspec.dependencies[package]!;
202+
for (final dependency in pubspec.dependencies.values) {
204203
if (dependency is PathDependency) {
205-
final dependencyDirectory = Directory(dependency.path);
204+
final dependencyDirectory = Directory(
205+
p.normalize(p.join(currentPath, dependency.path)),
206+
);
206207
// It may be okay to do some more complicated copying here for path
207208
// dependencies that aren't immediately under `fixtures`, but for now,
208209
// only support those that are.
209210
assert(
210-
dependencyDirectory.parent == Directory(currentPath).parent,
211+
dependencyDirectory.parent.path == Directory(currentPath).parent.path,
211212
'Path dependency of $packageDirectory: '
212-
'${dependencyDirectory.absolute.path} is not an immediate directory '
213-
'in `fixtures`.',
213+
'${dependencyDirectory.path} is not an immediate directory in '
214+
'`fixtures`.',
214215
);
215216
_copyPackageAndPathDependenciesIntoTempDirectory(
216217
tempDirectory,
217-
p.dirname(dependencyDirectory.path),
218+
p.basename(dependencyDirectory.path),
218219
copiedPackageDirectories,
219220
);
220221
}

0 commit comments

Comments
 (0)