Skip to content

Commit 6fe9a57

Browse files
committed
Fixed loading plugin files (only .js files will load).
1 parent 2eeecff commit 6fe9a57

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
0.0.14
33
========================
44

5+
- fixed loading plugin files (only `.js` files will load)
6+
57
========================
68
0.0.13
79
========================

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ F.load = async function(types, callback) {
760760
if (typeof(types) === 'string')
761761
types = types.split(',').trim();
762762

763-
var list = async (path, extension = 'js') => new Promise(resolve => F.TUtils.ls(path, files => resolve(files), (path, isdir) => isdir ? true : (path.indexOf('-bk') === -1 && path.indexOf('_bk') === -1 && F.TUtils.getExtension(path) === extension)));
763+
var list = async (path, extension = 'js') => new Promise(resolve => F.TUtils.ls(path, files => resolve(files), (path, isdir) => isdir ? true : (!path.includes('-bk') && !path.includes('_bk') && F.TUtils.getExtension(path) === extension)));
764764
var read = async (path) => new Promise(resolve => F.Fs.readFile(path, 'utf8', (err, response) => resolve(response ? response : '')));
765765

766766
var update = function(type, arr) {
@@ -827,7 +827,7 @@ F.load = async function(types, callback) {
827827

828828
for (let plugin of tmp) {
829829

830-
if (plugin.indexOf('-bk') !== -1 || plugin.indexOf('_bk') !== -1)
830+
if (plugin.includes('-bk') || plugin.includes('_bk') || !plugin.endsWith('.js'))
831831
continue;
832832

833833
files.push({ id: F.TUtils.getName(plugin).replace(/\.js$/, ''), type: 'plugins', filename: F.path.directory('plugins', plugin + '/index.js') });

0 commit comments

Comments
 (0)