fix(Xo#registerPlugin): do not error if plugin not configured (#566)
This commit is contained in:
parent
8c7d254244
commit
05e75c9a26
@ -90,23 +90,17 @@ export default class {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure plugin if necessary. (i.e. configurationSchema)
|
if (configurationSchema !== undefined) {
|
||||||
// Load plugin.
|
if (configuration === undefined) {
|
||||||
// Ignore configuration and loading errors.
|
return
|
||||||
Promise.resolve()
|
}
|
||||||
.then(() => {
|
|
||||||
if (!plugin.configured) {
|
await this._configurePlugin(plugin, configuration)
|
||||||
return this._configurePlugin(plugin, configuration)
|
}
|
||||||
}
|
|
||||||
})
|
if (autoload) {
|
||||||
.then(() => {
|
await this.loadPlugin(id)
|
||||||
if (autoload) {
|
}
|
||||||
return this.loadPlugin(id)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error('register plugin %s: %s', name, (error && error.stack) || error)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async _getPlugin (id) {
|
async _getPlugin (id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user