Array.reduce instead of Promise.reduce

This commit is contained in:
Daniel Schep 2019-08-27 14:11:04 -04:00
parent 729381f25e
commit b5757d334a

View File

@ -530,9 +530,9 @@ class PluginManager {
*/
run(commandsArray) {
// first initialize hooks
return BbPromise.reduce(this.getHooks(['initialize']), (__, { hook }) => hook(), null).then(
() => this.invoke(commandsArray)
);
return this.getHooks(['initialize'])
.reduce((chain, { hook }) => chain.then(hook), Promise.resolve())
.then(() => this.invoke(commandsArray));
}
/**