Skip to content

Commit

Permalink
fix: handle case where there is no active electron beta line
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed May 25, 2021
1 parent 857624d commit 00ecb65
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ function getNextTarget (runtime, targets) {
if (targets == null) targets = allTargets
var latest = targets.filter(function (t) { return t.runtime === runtime }).slice(-1)[0]
var increment = runtime === 'electron' ? 'minor' : 'major'
return semver.inc(latest.target, increment)
var next = semver.inc(latest.target, increment)
// Electron releases appear in the registry in their beta form, sometimes there is
// no active beta line. During this time we need to double bump
if (runtime === 'electron' && semver.parse(latest.target).prerelease.length) {
next = semver.inc(next, 'major')
}
return next
}

function getAbi (target, runtime) {
Expand Down

0 comments on commit 00ecb65

Please sign in to comment.