Skip to content

Commit

Permalink
Merge pull request #2047 from Tyriar/2044_cd_fix
Browse files Browse the repository at this point in the history
Base the next beta version on the correct current beta
  • Loading branch information
Tyriar committed May 9, 2019
2 parents 4729bfa + 0d5cd95 commit 2d0937a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ function getNextBetaVersion() {
if (publishedVersions.length === 0) {
return `${packageJson.version}-${tag}1`;
}
const latestPublishedVersion = publishedVersions.sort((a, b) => b.localeCompare(a))[0];
const latestPublishedVersion = publishedVersions.sort((a, b) => {
if (b.length > a.length) {
return true;
} else if (b.length < a.length) {
return false;
}
return b.localeCompare(a)
})[0];
const latestTagVersion = parseInt(latestPublishedVersion.substr(latestPublishedVersion.search(/[0-9]+$/)), 10);
return `${nextStableVersion}-${tag}${latestTagVersion + 1}`;
}
Expand Down

0 comments on commit 2d0937a

Please sign in to comment.