scanAll static method
The ecosystem packages in each of dirs — say a workspace's
packages/ and plugins/ — in name order. A package checked out in
two of them throws DevLinkClash: which one to link is for the
developer to say.
Implementation
static List<Checkout> scanAll(Iterable<Directory> dirs) {
final byName = <String, Checkout>{};
for (final dir in dirs) {
for (final c in scan(dir)) {
final seen = byName[c.name];
// The same folder, named twice or two ways, is one checkout.
if (seen != null && !samePath(seen.path, c.path)) {
throw DevLinkClash(c.name, [seen.path, c.path]);
}
byName[c.name] = c;
}
}
return byName.values.toList()..sort((a, b) => a.name.compareTo(b.name));
}