Skip to content

Commit

Permalink
fix(add default npm registry as an explicit parameter to npm publish …
Browse files Browse the repository at this point in the history
…command.):
  • Loading branch information
Pavel910 committed May 28, 2018
1 parent 963fc4f commit 9f52461
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/plugins/npm/publish.js
Expand Up @@ -3,7 +3,7 @@ import path from "path";
import fs from "fs-extra";

export default (config = {}) => {
const { registry, tag } = config;
const { registry = "https://registry.npmjs.org", tag } = config;

return async ({ packages, logger, config }, next) => {
for (let i = 0; i < packages.length; i++) {
Expand All @@ -20,7 +20,7 @@ export default (config = {}) => {
const command = [
`npm publish`,
tag ? `--tag ${tag}` : null,
registry ? `--registry ${registry}` : null,
`--registry ${registry}`,
pkg.location
]
.filter(v => v)
Expand Down
5 changes: 4 additions & 1 deletion tests/npmPublish.test.js
Expand Up @@ -171,6 +171,9 @@ describe("npmPublish plugin test", function() {
const release = compose([npmPublishFactory()]);
await release(params);

expect(logger.log.args[1]).to.deep.equal(["DRY: %s", "npm publish " + pkg.location]);
expect(logger.log.args[1]).to.deep.equal([
"DRY: %s",
"npm publish --registry https://registry.npmjs.org " + pkg.location
]);
});
});

0 comments on commit 9f52461

Please sign in to comment.