Skip to content
Snippets Groups Projects
Commit 4e8d4f45 authored by GyDi's avatar GyDi
Browse files

fix: version update error

parent 0f5d2b15
No related branches found
No related tags found
No related merge requests found
......@@ -11,10 +11,16 @@ async function resolvePublish() {
let [a, b, c] = packageJson.version.split(".").map(Number);
if (flag === "major") a += 1;
else if (flag === "minor") b += 1;
else if (flag === "patch") c += 1;
else throw new Error(`invalid flag "${flag}"`);
if (flag === "major") {
a += 1;
b = 0;
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}`;
packageJson.version = nextVersion;
......
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