Skip to content

Commit

Permalink
Merge pull request #20 from capricorn86/fix-problem-with-next-version
Browse files Browse the repository at this point in the history
fix: [#1] Fixes problem with calculating next version
  • Loading branch information
capricorn86 authored Jan 29, 2024
2 parents 39d1eb4 + 95c8aa0 commit 8a6031a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .lintignore → .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/node_modules
**/tmp
**/lib
.turbo
.eslintrc.cjs
.prettierrc.cjs
vitest.config.ts
11 changes: 8 additions & 3 deletions src/ConventionalCommitVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ export default class ConventionalCommitVersion {

for (const commit of commits.split(/[\n\r]/gm)) {
const parts = commit.trim().split(':');
if (parts.length === 1 && !commit.startsWith('Merge ')) {
if (parts[0]) {
if (parts.length === 1) {
if (parts[0] && !commit.startsWith('Merge ')) {
change.patch = true;
}
} else {
const type = parts[0];
const type = parts[0].split('[')[0];
switch (type) {
case 'BREAKING CHANGE':
change.major = true;
Expand All @@ -53,6 +53,11 @@ export default class ConventionalCommitVersion {
case 'fix':
change.patch = true;
break;
case 'chore':
break;
default:
change.patch = true;
break;
}
}
}
Expand Down

0 comments on commit 8a6031a

Please sign in to comment.