|
|
@ -1,6 +1,6 @@
|
|
|
|
const pkg = require("../../package.json");
|
|
|
|
const pkg = require("../../package.json");
|
|
|
|
const fs = require("fs");
|
|
|
|
const fs = require("fs");
|
|
|
|
const child_process = require("child_process");
|
|
|
|
const childProcess = require("child_process");
|
|
|
|
const util = require("../../src/util");
|
|
|
|
const util = require("../../src/util");
|
|
|
|
|
|
|
|
|
|
|
|
util.polyfill();
|
|
|
|
util.polyfill();
|
|
|
@ -32,7 +32,7 @@ if (! exists) {
|
|
|
|
function commit(version) {
|
|
|
|
function commit(version) {
|
|
|
|
let msg = "Update to " + version;
|
|
|
|
let msg = "Update to " + version;
|
|
|
|
|
|
|
|
|
|
|
|
let res = child_process.spawnSync("git", ["commit", "-m", msg, "-a"]);
|
|
|
|
let res = childProcess.spawnSync("git", ["commit", "-m", msg, "-a"]);
|
|
|
|
let stdout = res.stdout.toString().trim();
|
|
|
|
let stdout = res.stdout.toString().trim();
|
|
|
|
console.log(stdout);
|
|
|
|
console.log(stdout);
|
|
|
|
|
|
|
|
|
|
|
@ -40,15 +40,15 @@ function commit(version) {
|
|
|
|
throw new Error("commit error");
|
|
|
|
throw new Error("commit error");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
res = child_process.spawnSync("git", ["push", "origin", "master"]);
|
|
|
|
res = childProcess.spawnSync("git", ["push", "origin", "master"]);
|
|
|
|
console.log(res.stdout.toString().trim());
|
|
|
|
console.log(res.stdout.toString().trim());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function tag(version) {
|
|
|
|
function tag(version) {
|
|
|
|
let res = child_process.spawnSync("git", ["tag", version]);
|
|
|
|
let res = childProcess.spawnSync("git", ["tag", version]);
|
|
|
|
console.log(res.stdout.toString().trim());
|
|
|
|
console.log(res.stdout.toString().trim());
|
|
|
|
|
|
|
|
|
|
|
|
res = child_process.spawnSync("git", ["push", "origin", version]);
|
|
|
|
res = childProcess.spawnSync("git", ["push", "origin", version]);
|
|
|
|
console.log(res.stdout.toString().trim());
|
|
|
|
console.log(res.stdout.toString().trim());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -57,7 +57,7 @@ function tagExists(version) {
|
|
|
|
throw new Error("invalid version");
|
|
|
|
throw new Error("invalid version");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let res = child_process.spawnSync("git", ["tag", "-l", version]);
|
|
|
|
let res = childProcess.spawnSync("git", ["tag", "-l", version]);
|
|
|
|
|
|
|
|
|
|
|
|
return res.stdout.toString().trim() === version;
|
|
|
|
return res.stdout.toString().trim() === version;
|
|
|
|
}
|
|
|
|
}
|
|
|
|