mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2025-12-27 04:58:17 +00:00
Start increment at zero (MAJOR)
This commit is contained in:
parent
09f8bac4f7
commit
22cfb4bc0f
1 changed files with 3 additions and 3 deletions
6
index.js
6
index.js
|
|
@ -54,18 +54,18 @@ async function run() {
|
||||||
let history = (await cmd('git', 'log', '--pretty="%s"', root, mainBranch)).split(eol);
|
let history = (await cmd('git', 'log', '--pretty="%s"', root, mainBranch)).split(eol);
|
||||||
|
|
||||||
patch++;
|
patch++;
|
||||||
var increment = history.length;
|
var increment = history.length - 1;
|
||||||
for (var i = 0; i < history.length; i++) {
|
for (var i = 0; i < history.length; i++) {
|
||||||
if (history[i].indexOf(majorPattern) !== -1) {
|
if (history[i].indexOf(majorPattern) !== -1) {
|
||||||
major++;
|
major++;
|
||||||
minor = 0;
|
minor = 0;
|
||||||
patch = 0;
|
patch = 0;
|
||||||
increment = i + 1;
|
increment = i;
|
||||||
break;
|
break;
|
||||||
} else if (history[i].indexOf(minorPattern) !== -1) {
|
} else if (history[i].indexOf(minorPattern) !== -1) {
|
||||||
minor++;
|
minor++;
|
||||||
patch = 0;
|
patch = 0;
|
||||||
increment = i + 1;
|
increment = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue