Fix versioning script

This commit is contained in:
Wilson Lin 2020-05-18 08:42:23 +10:00
parent caa738b8a9
commit 2591f2879d
1 changed files with 5 additions and 1 deletions

View File

@ -15,7 +15,11 @@ const assertBetween = (n, min, max) => {
};
const newVersion = currentVersion.slice();
newVersion[assertBetween(['major', 'minor', 'patch'].indexOf(process.argv[2].toLowerCase()), 0, 2)]++;
let versionPart = assertBetween(['major', 'minor', 'patch'].indexOf(process.argv[2].toLowerCase()), 0, 2);
newVersion[versionPart++]++;
while (versionPart < 3) {
newVersion[versionPart++] = 0;
}
console.log(`${currentVersion.join('.')} => ${newVersion.join('.')}`);