Piotr Grzesik 2a9f79f19e refactor: Revert bluebird from lib/plugins/plugin
This reverts commit 9e7960297227b39f05c2619a80e3cac7cb7be1a5.
2021-03-04 11:06:44 +01:00

37 lines
721 B
JavaScript

'use strict';
const BbPromise = require('bluebird');
const pluginUtils = require('./lib/utils');
class PluginList {
constructor(serverless, options) {
this.serverless = serverless;
this.options = options;
Object.assign(this, pluginUtils);
this.commands = {
plugin: {
commands: {
list: {
usage: 'Lists all available plugins',
lifecycleEvents: ['list'],
},
},
},
};
this.hooks = {
'plugin:list:list': () => BbPromise.bind(this).then(this.list),
};
}
list() {
return BbPromise.bind(this)
.then(this.getPlugins)
.then((plugins) => this.display(plugins));
}
}
module.exports = PluginList;