Skip to content

Commit

Permalink
fix(bootstrap): Remove redundant duplicate name check
Browse files Browse the repository at this point in the history
  • Loading branch information
evocateur committed Aug 20, 2018
1 parent 387df2b commit c2405a1
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions commands/bootstrap/index.js
Expand Up @@ -87,8 +87,6 @@ class BootstrapCommand extends Command {
this.filteredPackages = filteredPackages;
});

chain = chain.then(() => this.validatePackageNames());

chain = chain.then(() => {
this.batchedPackages = this.toposort
? batchPackages(this.filteredPackages, this.options.rejectCycles)
Expand Down Expand Up @@ -559,29 +557,6 @@ class BootstrapCommand extends Command {
symlinkPackages() {
return symlinkDependencies(this.filteredPackages, this.packageGraph, this.logger);
}

validatePackageNames() {
const seen = new Map();

for (const { name, location } of this.filteredPackages) {
if (seen.has(name)) {
seen.get(name).push(location);
} else {
seen.set(name, [location]);
}
}

for (const [name, locations] of seen) {
if (locations.length > 1) {
throw new ValidationError(
"ENAME",
[`Package name "${name}" used in multiple packages:`, ...locations].join("\n\t")
);
}
}

// hooray no duplicates
}
}

module.exports.BootstrapCommand = BootstrapCommand;

0 comments on commit c2405a1

Please sign in to comment.