Update indexjs

Signed-off-by: Shakar <5h4k4r.b4kr@gmail.com>
This commit is contained in:
Shakar 2023-09-17 14:17:21 +03:00
parent 51bac3bf73
commit 74f60450b3
No known key found for this signature in database
GPG Key ID: DA55A26823AE3C28

View File

@ -11,10 +11,17 @@ try {
const version = require('./package.json').version;
// the version is in semantic format, so we can split it by dot
const versionParts = version.split('.');
if (label === 'major')
if (label === 'major') {
versionParts[0] = parseInt(versionParts[0]) + 1;
else if (label == 'minor')
versionParts[1] = 0;
versionParts[2] = 0;
}
else if (label == 'minor') {
versionParts[1] = parseInt(versionParts[1]) + 1;
versionParts[2] = 0;
}
else if (label == 'patch')
versionParts[2] = parseInt(versionParts[2]) + 1;