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