Skip to content

Commit

Permalink
redo
Browse files Browse the repository at this point in the history
  • Loading branch information
telackey committed Dec 15, 2020
1 parent 62570a2 commit c9d2797
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8637,15 +8637,19 @@ class ConventionalCommits {
}
async guessReleaseType(preMajor) {
const VERSIONS = ['major', 'minor', 'patch'];
const preset = await presetFactory({ preMajor: preMajor || this.bumpMinorOnBreaking });
const preset = await presetFactory({ preMajor });
return new Promise((resolve, reject) => {
const stream = this.commitsReadable()
.pipe(conventionalCommitsParser(preset.parserOpts))
.pipe(concat((data) => {
const commits = conventionalCommitsFilter(data);
let result = preset.recommendedBumpOpts.whatBump(commits, preset.recommendedBumpOpts);
if (result && result.level !== null) {
result.releaseType = VERSIONS[result.level];
// Demote everything one level with bumpMinorOnBreaking.
const level = this.bumpMinorOnBreaking ?
Math.max(result.level - 1, 2) :
result.level;
result.releaseType = VERSIONS[level];
}
else if (result === null) {
result = {};
Expand Down

0 comments on commit c9d2797

Please sign in to comment.