mirror of
https://github.com/mtan93/homebridge.git
synced 2026-04-05 06:13:13 +01:00
@@ -137,11 +137,18 @@ Plugin.installed = function() {
|
|||||||
|
|
||||||
var plugins = [];
|
var plugins = [];
|
||||||
var pluginsByName = {}; // don't add duplicate 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
|
// search for plugins among all known paths, in order
|
||||||
for (var index in Plugin.paths) {
|
for (var index in Plugin.paths) {
|
||||||
var requirePath = Plugin.paths[index];
|
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!
|
// just because this path is in require.main.paths doesn't mean it necessarily exists!
|
||||||
if (!fs.existsSync(requirePath))
|
if (!fs.existsSync(requirePath))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user