Skip to content

Commit e45f284

Browse files
committed
bump major version after 999 edits
1 parent 18628b5 commit e45f284

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

editor/src/app/state/extensions/effects.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,14 @@ function bumpVersion(version?: string): string {
434434
if (!version) {
435435
return '0.1';
436436
}
437-
const parts = version.split('.');
438-
const last = parts.pop() ?? '0';
439-
return [...parts, isNaN(+last) ? 0 : +last + 1].join('.');
437+
const [major, minor] = version.split('.');
438+
let newMinor = isNaN(+minor) ? 0 : +minor;
439+
let newMajor = isNaN(+major) ? 0 : +major;
440+
441+
newMinor += 1;
442+
if (newMinor > 999) {
443+
newMinor = 0;
444+
newMajor += 1;
445+
}
446+
return [newMajor, newMinor].join('.');
440447
}

0 commit comments

Comments
 (0)