⚡️ 细节优化
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import plugin from "../../../lib/plugins/plugin.js"
|
|
||||||
import { update } from "../../other/update.js"
|
import { update } from "../../other/update.js"
|
||||||
import { Version, Plugin_Name } from "../components/index.js"
|
import { Version, Plugin_Name } from "../components/index.js"
|
||||||
import { puppeteer } from "../model/index.js"
|
import { puppeteer } from "../model/index.js"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { formatDuration } from "../../tools/index.js"
|
|||||||
import { osInfo, si } from "./utils.js"
|
import { osInfo, si } from "./utils.js"
|
||||||
let loader = null
|
let loader = null
|
||||||
try {
|
try {
|
||||||
|
// eslint-disable-next-line import/no-unresolved
|
||||||
loader = (await import("../../../../lib/plugins/loader.js")).default
|
loader = (await import("../../../../lib/plugins/loader.js")).default
|
||||||
} catch {
|
} catch {
|
||||||
|
|
||||||
@@ -48,9 +49,15 @@ function getPluginNum(e) {
|
|||||||
const plugins = plugin?.length
|
const plugins = plugin?.length
|
||||||
// 获取js插件数量,以.js结尾的文件视为一个插件
|
// 获取js插件数量,以.js结尾的文件视为一个插件
|
||||||
const jsDir = path.join(dir, "example")
|
const jsDir = path.join(dir, "example")
|
||||||
const js = fs.readdirSync(jsDir)
|
let js = 0
|
||||||
?.filter(item => item.endsWith(".js"))
|
try {
|
||||||
?.length
|
js = fs.readdirSync(jsDir)
|
||||||
|
?.filter(item => item.endsWith(".js"))
|
||||||
|
?.length
|
||||||
|
} catch (error) {
|
||||||
|
logger.debug(error)
|
||||||
|
}
|
||||||
|
|
||||||
const pluginsStr = `${plugins ?? 0} plugins | ${js ?? 0} js`
|
const pluginsStr = `${plugins ?? 0} plugins | ${js ?? 0} js`
|
||||||
if (loader && e.isPro) {
|
if (loader && e.isPro) {
|
||||||
const { priority, task } = loader
|
const { priority, task } = loader
|
||||||
|
|||||||
Reference in New Issue
Block a user