fix: version update error
This commit is contained in:
parent
0f5d2b15e0
commit
4e8d4f4591
@ -11,10 +11,16 @@ async function resolvePublish() {
|
|||||||
|
|
||||||
let [a, b, c] = packageJson.version.split(".").map(Number);
|
let [a, b, c] = packageJson.version.split(".").map(Number);
|
||||||
|
|
||||||
if (flag === "major") a += 1;
|
if (flag === "major") {
|
||||||
else if (flag === "minor") b += 1;
|
a += 1;
|
||||||
else if (flag === "patch") c += 1;
|
b = 0;
|
||||||
else throw new Error(`invalid flag "${flag}"`);
|
c = 0;
|
||||||
|
} else if (flag === "minor") {
|
||||||
|
b += 1;
|
||||||
|
c = 0;
|
||||||
|
} else if (flag === "patch") {
|
||||||
|
c += 1;
|
||||||
|
} else throw new Error(`invalid flag "${flag}"`);
|
||||||
|
|
||||||
const nextVersion = `${a}.${b}.${c}`;
|
const nextVersion = `${a}.${b}.${c}`;
|
||||||
packageJson.version = nextVersion;
|
packageJson.version = nextVersion;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user