Skip to content

Commit

Permalink
fix(collect-updates): Avoid improper bumps from prompt selections
Browse files Browse the repository at this point in the history
Fixes lerna#1357

Huge thanks to all the contributors on that issue, especially @Adam13531
for their exceptionally detailed reproduction and @randy-askin for their
clear (and patient!) identification of the ternary bug.
  • Loading branch information
evocateur committed Jan 9, 2019
1 parent 69208ed commit 2f04483
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions collect-updates.js
Expand Up @@ -56,10 +56,11 @@ function collectUpdates(filteredPackages, packageGraph, execOpts, commandOptions
candidates = new Set();

const hasDiff = makeDiffPredicate(committish, execOpts, commandOptions.ignoreChanges);
const needsBump = (commandOptions.bump || "").startsWith("pre")
? () => false
: /* skip packages that have not been previously prereleased */
node => node.prereleaseId;
const needsBump =
!commandOptions.bump || commandOptions.bump.startsWith("pre")
? () => false
: /* skip packages that have not been previously prereleased */
node => node.prereleaseId;

packages.forEach((node, name) => {
if (forced.has(name) || needsBump(node) || hasDiff(node)) {
Expand Down

0 comments on commit 2f04483

Please sign in to comment.