( plugin: string, scope?: InstallableScope, )
| 229 | * @param scope Optional scope. If not provided, finds the most specific scope for the current project. |
| 230 | */ |
| 231 | export async function disablePlugin( |
| 232 | plugin: string, |
| 233 | scope?: InstallableScope, |
| 234 | ): Promise<void> { |
| 235 | try { |
| 236 | const result = await disablePluginOp(plugin, scope) |
| 237 | |
| 238 | if (!result.success) { |
| 239 | throw new Error(result.message) |
| 240 | } |
| 241 | |
| 242 | console.log(`${figures.tick} ${result.message}`) |
| 243 | |
| 244 | const { name, marketplace } = parsePluginIdentifier( |
| 245 | result.pluginId || plugin, |
| 246 | ) |
| 247 | logEvent('tengu_plugin_disabled_cli', { |
| 248 | _PROTO_plugin_name: |
| 249 | name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED, |
| 250 | ...(marketplace && { |
| 251 | _PROTO_marketplace_name: |
| 252 | marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED, |
| 253 | }), |
| 254 | scope: |
| 255 | result.scope as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 256 | ...buildPluginTelemetryFields(name, marketplace, getManagedPluginNames()), |
| 257 | }) |
| 258 | |
| 259 | // eslint-disable-next-line custom-rules/no-process-exit |
| 260 | process.exit(0) |
| 261 | } catch (error) { |
| 262 | handlePluginCommandError(error, 'disable', plugin) |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | /** |
| 267 | * CLI command: Disable all enabled plugins non-interactively |
no test coverage detected