mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
🪛 chore: 轻度修改插件架构
This commit is contained in:
parent
505d5a18c8
commit
b4ce6c95e0
@ -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";
|
||||
|
4
index.js
4
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"));
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user