Don't try and load non .js extensions (#3409)

* only try and load extensions ending in .js

* Update controller.js

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
This commit is contained in:
Jorge Schrauwen 2020-04-22 18:52:09 +02:00 committed by GitHub
parent 99acd3b50f
commit 8d70ebd91a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,7 @@ class Controller {
const extensionPath = data.joinPath('extension');
if (fs.existsSync(extensionPath)) {
const extensions = fs.readdirSync(extensionPath);
const extensions = fs.readdirSync(extensionPath).filter((f) => f.endsWith('.js'));
for (const extension of extensions) {
const Extension = require(path.join(extensionPath, extension.split('.')[0]));
this.extensions.push(new Extension(...args, logger));