|
@@ -42,7 +42,13 @@ if (fs.existsSync("dist")) {
|
|
|
const hash = crypto.createHash("sha256").update(zipData).digest("hex");
|
|
|
console.log(`SHA-256: ${hash}`);
|
|
|
|
|
|
+ // 当前时间
|
|
|
+ const now = new Date();
|
|
|
+ const fmt = now.toISOString()
|
|
|
+ .replace('T', ' ')
|
|
|
+ .slice(0, 19);
|
|
|
// 4. 修改 update.json 的 checksum
|
|
|
+ updata.releaseDate = fmt
|
|
|
updata.checksum = hash; // 假设 update.json 有 checksum 字段
|
|
|
fs.writeFileSync(updateJsonPath, JSON.stringify(updata, null, 2)); // 2 空格缩进
|
|
|
fs.writeFileSync("src/updater/update.json", JSON.stringify(updata, null, 2)); // 2 空格缩进
|