UNPKG

cli-engine

Version:
34 lines (26 loc) 983 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _cliEngineCommand = require('cli-engine-command'); var _cliEngineCommand2 = _interopRequireDefault(_cliEngineCommand); var _plugins = require('../plugins'); var _plugins2 = _interopRequireDefault(_plugins); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class _class extends _cliEngineCommand2.default { async run() { this.plugins = new _plugins2.default(this.config); const [command] = this.argv; const plugin = await this.plugins.findPluginWithCommand(command); if (!plugin) throw new Error('not found'); this.out.styledHeader(`Plugin ${plugin.name}`); this.out.styledObject({ type: plugin.type, path: plugin.pluginPath.path }, ['type', 'path']); } } exports.default = _class; _class.topic = 'which'; _class.description = 'show which plugin a command is from'; _class.args = [{ name: 'command' }];