mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 04:45:46 +00:00
fix:checkVesion
This commit is contained in:
parent
84083a65a8
commit
fe0f82fa2b
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,3 +14,4 @@ src/core.lib/common/
|
|||||||
|
|
||||||
# Build
|
# Build
|
||||||
*.db
|
*.db
|
||||||
|
checkVersion.sh
|
@ -1,16 +1,16 @@
|
|||||||
let fs = require("fs");
|
let fs = require("fs");
|
||||||
let process = require("process")
|
let process = require("process")
|
||||||
console.log("[NapCat] [CheckVersion] 开始检测当前仓库版本...");
|
console.log("[NapCat] [CheckVersion] 开始检测当前仓库版本...");
|
||||||
let currentVersion = require("./package.json").version;
|
let currentVersion = require("../package.json").version;
|
||||||
let targetVersion = process.env.VERSION;
|
let targetVersion = process.env.VERSION;
|
||||||
console.log("[NapCat] [CheckVersion] currentVersion:", currentVersion, " targetVersion:", targetVersion);
|
console.log("[NapCat] [CheckVersion] currentVersion:", currentVersion, " targetVersion:", targetVersion);
|
||||||
// 借用dist目录输出脚本
|
// 借用dist目录输出脚本
|
||||||
fs.mkdir("./dist");
|
fs.mkdir("./dist");
|
||||||
if (currentVersion === targetVersion) {
|
if (currentVersion === targetVersion) {
|
||||||
fs.appendFileSync("./checkVersion.sh", "#!/bin/bashe\necho \"CheckVersion Is Done\"")
|
fs.appendFileSync("../checkVersion.sh", "#!/bin/bashe\necho \"CheckVersion Is Done\"")
|
||||||
} else {
|
} else {
|
||||||
let packageJson = JSON.parse(fs.readFileSync("./package.json"));
|
let packageJson = JSON.parse(fs.readFileSync("./package.json"));
|
||||||
packageJson.version = targetVersion;
|
packageJson.version = targetVersion;
|
||||||
fs.writeFileSync("./package.json", JSON.stringify(packageJson));
|
fs.writeFileSync("../package.json", JSON.stringify(packageJson));
|
||||||
fs.appendFileSync("./checkVersion.sh", "#!/bin/bashe\ngit add .\n git commit -m \"chore:version change\"\n git push")
|
fs.appendFileSync("../checkVersion.sh", "#!/bin/bashe\ngit add .\n git commit -m \"chore:version change\"\n git push")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user