mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-08 05:31:55 +00:00
@@ -137,11 +137,18 @@ Plugin.installed = function() {
|
||||
|
||||
var plugins = [];
|
||||
var pluginsByName = {}; // don't add duplicate plugins
|
||||
var searchedPaths = {}; // don't search the same paths twice
|
||||
|
||||
// search for plugins among all known paths, in order
|
||||
for (var index in Plugin.paths) {
|
||||
var requirePath = Plugin.paths[index];
|
||||
|
||||
// did we already search this path?
|
||||
if (searchedPaths[requirePath])
|
||||
continue;
|
||||
|
||||
searchedPaths[requirePath] = true;
|
||||
|
||||
// just because this path is in require.main.paths doesn't mean it necessarily exists!
|
||||
if (!fs.existsSync(requirePath))
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user