代码拉取完成,页面将自动刷新
import fs from "node:fs";
import chalk from 'chalk'
import path from 'path'
try {
await import('axios')
} catch (error) {
if (error.stack?.includes('Cannot find package')) {
logger.warn('--------biscuit依赖缺失--------')
logger.warn(`biscuit-plugin 缺少依赖将无法使用 ${logger.yellow('部分用不了')}`)
logger.warn(`如需使用请运行:${logger.red('pnpm add axios -w')}`)
logger.warn('---------------------------')
logger.debug(decodeURI(error.stack))
} else {
logger.error(`biscuit载入依赖错误:${logger.red('axios')}`)
logger.error(decodeURI(error.stack))
}
}
logger.info(chalk.cyan('----------\(≧▽≦)/---------'))
logger.info(chalk.yellow(`biscuit-plugin初始化~`))
logger.info(chalk.yellow(`发送饼干帮助解锁功能哦~`))
logger.info(chalk.magenta('-------------------------'))
const files = fs
.readdirSync("./plugins/biscuit-plugin/apps")
.filter((file) => file.endsWith(".js"));
let ret = [];
files.forEach((file) => {
ret.push(import(`./apps/${file}`));
});
ret = await Promise.allSettled(ret);
let apps = {};
for (let i in files) {
let name = files[i].replace(".js", "");
if (ret[i].status != "fulfilled") {
logger.error(`载入插件错误:${logger.red(name)}`);
logger.error(ret[i].reason);
continue;
}
apps[name] = ret[i].value[Object.keys(ret[i].value)[0]];
}
export { apps };
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。