mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-08 14:23:22 +08:00
Update beta process
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
const pkg = require("../../package.json");
|
||||
const fs = require("fs");
|
||||
const util = require("../../src/util");
|
||||
|
||||
util.polyfill();
|
||||
|
||||
const oldVersion = pkg.oldVersion;
|
||||
|
||||
if (!oldVersion) {
|
||||
console.log("Error: no old version?");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
delete pkg.oldVersion;
|
||||
pkg.version = oldVersion;
|
||||
fs.writeFileSync("package.json", JSON.stringify(pkg, null, 4) + "\n");
|
@@ -24,9 +24,9 @@ const exists = tagExists(version);
|
||||
|
||||
if (! exists) {
|
||||
// Process package.json
|
||||
pkg.oldVersion = oldVersion;
|
||||
pkg.version = version;
|
||||
fs.writeFileSync("package.json", JSON.stringify(pkg, null, 4) + "\n");
|
||||
commit(version);
|
||||
tag(version);
|
||||
|
||||
} else {
|
||||
@@ -34,6 +34,18 @@ if (! exists) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function commit(version) {
|
||||
let msg = "Update to " + version;
|
||||
|
||||
let res = child_process.spawnSync("git", ["commit", "-m", msg, "-a"]);
|
||||
let stdout = res.stdout.toString().trim();
|
||||
console.log(stdout);
|
||||
|
||||
if (stdout.includes("no changes added to commit")) {
|
||||
throw new Error("commit error");
|
||||
}
|
||||
}
|
||||
|
||||
function tag(version) {
|
||||
let res = child_process.spawnSync("git", ["tag", version]);
|
||||
console.log(res.stdout.toString().trim());
|
||||
|
Reference in New Issue
Block a user