mirror of
https://github.com/Le-niao/Yunzai-Bot.git
synced 2025-01-07 08:36:39 +08:00
监听新增插件时校验,防止载入插件子级目录(如model)下插件
This commit is contained in:
parent
406e88bb19
commit
52770a7c58
@ -773,6 +773,7 @@ class PluginsLoader {
|
||||
watcher.on('add', async PluPath => {
|
||||
let appName = path.basename(PluPath)
|
||||
if (!appName.endsWith('.js')) return
|
||||
if (!fs.existsSync(`${this.dir}/${dirName}/${appName}`)) return
|
||||
|
||||
let key = `${dirName}/${appName}`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user