Skip to content

Commit

Permalink
Fix multiple version bumps when publishing using Yarn (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
itaisteinherz authored and sindresorhus committed Apr 18, 2019
1 parent fed7766 commit 3601af5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions source/npm/publish.js
Expand Up @@ -4,17 +4,13 @@ const {from} = require('rxjs');
const {catchError} = require('rxjs/operators');
const handleNpmError = require('./handle-npm-error');

const pkgPublish = (pkgManager, options, input) => {
const pkgPublish = (pkgManager, options) => {
const args = ['publish'];

if (options.contents) {
args.push(options.contents);
}

if (options.yarn) {
args.push('--new-version', input);
}

if (options.tag) {
args.push('--tag', options.tag);
}
Expand All @@ -35,6 +31,6 @@ module.exports = (context, pkgManager, task, options, input) =>
catchError(error => handleNpmError(error, task, otp => {
context.otp = otp;

return pkgPublish(pkgManager, {...options, otp}, input);
return pkgPublish(pkgManager, {...options, otp});
}))
);

0 comments on commit 3601af5

Please sign in to comment.