MCPcopy
hub / github.com/homebridge/homebridge / initializeInstalledPlugins

Method initializeInstalledPlugins

src/pluginManager.ts:173–207  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

171 }
172
173 public async initializeInstalledPlugins(): Promise<void> {
174 log.info('---')
175
176 this.loadInstalledPlugins()
177
178 for (const [identifier, plugin] of this.plugins) {
179 try {
180 await plugin.load()
181 } catch (error: any) {
182 log.error('====================')
183 log.error(`ERROR LOADING PLUGIN ${identifier}:`)
184 log.error(error.stack)
185 log.error('====================')
186
187 this.plugins.delete(identifier)
188 continue
189 }
190
191 if (this.disabledPlugins && this.disabledPlugins.includes(plugin.getPluginIdentifier())) {
192 plugin.disabled = true
193 }
194
195 if (plugin.disabled) {
196 log.warn(`Disabled plugin: ${identifier}@${plugin.version}`)
197 } else {
198 log.info(`Loaded plugin: ${identifier}@${plugin.version}`)
199 }
200
201 await this.initializePlugin(plugin, identifier)
202
203 log.info('---')
204 }
205
206 this.currentInitializingPlugin = undefined
207 }
208
209 public async initializePlugin(plugin: Plugin, identifier: string): Promise<void> {
210 try {

Callers 1

startMethod · 0.80

Calls 7

loadInstalledPluginsMethod · 0.95
initializePluginMethod · 0.95
infoMethod · 0.80
errorMethod · 0.80
warnMethod · 0.80
loadMethod · 0.45
getPluginIdentifierMethod · 0.45

Tested by

no test coverage detected