()
| 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 { |
no test coverage detected