(type: PluginType)
| 84 | } |
| 85 | |
| 86 | async remove(type: PluginType): Promise<{ |
| 87 | manager: Manager |
| 88 | noSave: boolean |
| 89 | plugins: string[] |
| 90 | }> { |
| 91 | const { |
| 92 | argv, |
| 93 | flags: { 'no-save': noSave }, |
| 94 | } = await this.parse(OperationBaseCommand) |
| 95 | const allPlugins = argv |
| 96 | const manager = await this.getPluginManager(type) |
| 97 | const lockFile = this.getLockFile() |
| 98 | const plugins = [] |
| 99 | |
| 100 | if (isEmpty(allPlugins)) { |
| 101 | this.logger.info( |
| 102 | `No ${messages[type]?.plural} were passed as a parameter.` |
| 103 | ) |
| 104 | this.exit() |
| 105 | } |
| 106 | |
| 107 | if (isEmpty(lockFile?.[type])) { |
| 108 | this.logger.info( |
| 109 | `No ${messages[type]?.plural} found, have you installed any?` |
| 110 | ) |
| 111 | this.exit() |
| 112 | } |
| 113 | |
| 114 | for (const key of allPlugins) { |
| 115 | this.logger.startSpinner( |
| 116 | `Removing ${chalk.italic.green(key)} ${messages[ |
| 117 | type |
| 118 | ]?.singular?.toLowerCase()}` |
| 119 | ) |
| 120 | |
| 121 | await manager.removePlugin(key) |
| 122 | |
| 123 | this.logger.successSpinner( |
| 124 | `${chalk.italic.green(key)} ${messages[ |
| 125 | type |
| 126 | ]?.singular?.toLowerCase()} removed successfully` |
| 127 | ) |
| 128 | |
| 129 | plugins.push(key) |
| 130 | } |
| 131 | return { |
| 132 | manager, |
| 133 | noSave, |
| 134 | plugins, |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | async update(type: PluginType): Promise<void> { |
| 139 | const { argv } = await this.parse(OperationBaseCommand) |
nothing calls this directly
no test coverage detected