Commit 0c99a4da authored by Medicean's avatar Medicean

(Enhance: Other) 优化插件加载, 加载异常的插件不会再影响到其它插件加载了

parent 76976672
......@@ -2,6 +2,12 @@
> 有空会补补BUG、添添新功能。
> 同时也欢迎大家的参与!感谢各位朋友的支持! .TAT.
## `v(2.1.10)`
### 其它
* 优化插件加载, 加载异常的插件不会再影响到其它插件加载了
## 2020/09/10 `v(2.1.9)`
### 核心
......
......@@ -125,10 +125,14 @@ const antSword = window.antSword = {
return
}
// 存储路径&&package信息到全局变量antSword['plugins']
antSword['plugins'][_] = {
_id: _,
path: pluginPath,
info: JSON.parse(fs.readFileSync(path.join(pluginPath, 'package.json')))
try {
antSword['plugins'][_] = {
_id: _,
path: pluginPath,
info: JSON.parse(fs.readFileSync(path.join(pluginPath, 'package.json')))
}
} catch (error) {
return
}
});
// 加载插件::开发
......@@ -142,10 +146,14 @@ const antSword = window.antSword = {
if (!fs.lstatSync(_path).isDirectory()) {
return
}
antSword['plugins'][_] = {
_id: _,
path: _path,
info: JSON.parse(fs.readFileSync(path.join(_path, 'package.json')))
try {
antSword['plugins'][_] = {
_id: _,
path: _path,
info: JSON.parse(fs.readFileSync(path.join(_path, 'package.json')))
}
} catch (error) {
return
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment