Skip to content

Commit

Permalink
fix(add): Avoid passing bad scope to pacote
Browse files Browse the repository at this point in the history
Fixes #1592
  • Loading branch information
evocateur committed Aug 21, 2018
1 parent 6abc0c9 commit ad649bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion commands/add/__tests__/add-command.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe("AddCommand", () => {
it("should only bootstrap scoped packages", async () => {
const testDir = await initFixture("basic");

await lernaAdd(testDir)("@test/package-1", "--scope", "@test/package-2", "--scope", "package-3");
await lernaAdd(testDir)("tiny-tarball", "--scope", "@test/package-2", "--scope", "package-3");

expect(bootstrap).lastCalledWith(
expect.objectContaining({
Expand Down
6 changes: 5 additions & 1 deletion commands/add/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ class AddCommand extends Command {
}

// @see https://github.com/zkat/pacote/blob/latest/lib/util/opt-check.js
const opts = npmConf(this.options);
const opts = npmConf({
includeDeprecated: false,
// we can't pass everything, as our --scope conflicts with pacote's --scope
registry: this.options.registry,
});

return pacote.manifest(this.spec, opts).then(pkg => pkg.version);
}
Expand Down

0 comments on commit ad649bf

Please sign in to comment.