Skip to content
Snippets Groups Projects
Commit 46226c27 authored by Ali Asaria's avatar Ali Asaria
Browse files

fix version bump calculation

parent 64677c70
No related branches found
No related tags found
No related merge requests found
......@@ -47,9 +47,21 @@ if (versionPart && !['major', 'minor', 'patch'].includes(versionPart)) {
const currentVersion = getVersion();
const versionParts = currentVersion.split('.');
if (versionPart === 'major') versionParts[0] = parseInt(versionParts[0]) + 1; // Bump the major version
if (versionPart === 'minor') versionParts[1] = parseInt(versionParts[1]) + 1; // Bump the minor version
if (versionPart === 'patch') versionParts[2] = parseInt(versionParts[2]) + 1; // Bump the patch version
// Bump the major version
if (versionPart === 'major') {
versionParts[0] = parseInt(versionParts[0]) + 1;
versionParts[1] = 0;
versionParts[2] = 0;
}
// Bump the minor version
if (versionPart === 'minor') {
versionParts[1] = parseInt(versionParts[1]) + 1;
versionParts[2] = 0;
}
// Bump the patch version
if (versionPart === 'patch') {
versionParts[2] = parseInt(versionParts[2]) + 1;
}
const newVersion = versionParts.join('.');
console.log(`Bumping version from ${currentVersion} to ${newVersion}`);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment