diff --git a/apps/update.js b/apps/update.js index a6dcbe3..d9d2dd8 100644 --- a/apps/update.js +++ b/apps/update.js @@ -5,6 +5,7 @@ import puppeteer from "../../../lib/puppeteer/puppeteer.js"; import lodash from "lodash"; import YAML from "yaml"; import fs from "node:fs"; +import path from "path"; import { exec, execSync } from "node:child_process"; import { copyFiles, deleteFolderRecursive, readCurrentDir } from "../utils/file.js"; diff --git a/index.js b/index.js index 30a65e5..d2f5c43 100644 --- a/index.js +++ b/index.js @@ -5,11 +5,13 @@ if (!global.segment) { global.segment = (await import("oicq")).segment } +// 加载版本号 const versionData = config.getConfig("version"); +// 加载名称 const packageJsonPath = path.join('./plugins', 'rconsole-plugin', 'package.json'); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); const pluginName = packageJson.name; - +// 初始化输出 logger.info(logger.yellow(`R插件${versionData[0].version}初始化,欢迎加入【R插件和它的朋友们】秋秋群:575663150`)); const files = fs.readdirSync(`./plugins/${pluginName}/apps`).filter(file => file.endsWith(".js")); diff --git a/model/config.js b/model/config.js index 27424af..a2a8703 100644 --- a/model/config.js +++ b/model/config.js @@ -8,7 +8,6 @@ class RConfig extends Base{ constructor(e) { super(e); this.configPath = `./plugins/${RConfig.pluginName}/config/`; - this.change = new Map(); this.previousContent = new Map(); // 存储每个文件之前的内容 } @@ -39,7 +38,6 @@ class RConfig extends Base{ const yaml = YAML.parse(fs.readFileSync(file, 'utf8')); if (isWatch) { - this.change.set(name); this.previousContent.set(name, yaml); // 保存初始内容 this.watch(file, name); }