1
0
mirror of https://github.com/KingRan/KR.git synced 2026-03-14 18:42:51 +08:00
This commit is contained in:
KingRan
2023-07-27 22:55:55 +08:00
parent 8fd2e7678b
commit b8bd9f4477
23 changed files with 3010 additions and 681 deletions

View File

@ -0,0 +1,20 @@
const notify = require('../sendNotify');
const fs = require('fs');
const notifyPath = '/scripts/logs/notify.txt';
async function image_update_notify() {
if (fs.existsSync(notifyPath)) {
const content = await fs.readFileSync(`${notifyPath}`, 'utf8');//读取notify.txt内容
if (process.env.NOTIFY_CONTENT && !content.includes(process.env.NOTIFY_CONTENT)) {
await notify.sendNotify("⚠Docker镜像版本更新通知⚠", process.env.NOTIFY_CONTENT);
await fs.writeFileSync(`${notifyPath}`, process.env.NOTIFY_CONTENT);
}
} else {
if (process.env.NOTIFY_CONTENT) {
notify.sendNotify("⚠Docker镜像版本更新通知⚠", process.env.NOTIFY_CONTENT)
await fs.writeFileSync(`${notifyPath}`, process.env.NOTIFY_CONTENT);
}
}
}
!(async() => {
await image_update_notify();
})().catch((e) => console.log(e))