From b4ce6c95e0ef4e1f9eacc7ab9b779d99d0f789db Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Sun, 11 Aug 2024 14:57:20 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=9B=20chore:=20=E8=BD=BB=E5=BA=A6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=92=E4=BB=B6=E6=9E=B6=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/update.js | 1 + index.js | 4 +++- model/config.js | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) 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); }