mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
add a hook for plugins to perform asyncronous initialization.
needed for SFE to enable deployment profiles
This commit is contained in:
parent
0626d5b5df
commit
537140ccbd
@ -70,7 +70,8 @@ class Serverless {
|
||||
}).then(() => {
|
||||
// load all plugins
|
||||
this.pluginManager.loadAllPlugins(this.service.plugins);
|
||||
|
||||
return this.pluginManager.asyncPluginInit();
|
||||
}).then(() => {
|
||||
// give the CLI the plugins and commands so that it can print out
|
||||
// information such as options when the user enters --help
|
||||
this.cli.setLoadedPlugins(this.pluginManager.getPlugins());
|
||||
|
||||
@ -549,6 +549,10 @@ class PluginManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
asyncPluginInit() {
|
||||
return BbPromise.map(this.plugins, plugin => (plugin.asyncInit && plugin.asyncInit()));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = PluginManager;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user