mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-16 18:39:09 -07:00
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:
parent
99acd3b50f
commit
8d70ebd91a
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user