(
name: string | undefined,
options: { cowork?: boolean },
)
| 610 | |
| 611 | // marketplace update (lines 5609–5672) |
| 612 | export async function marketplaceUpdateHandler( |
| 613 | name: string | undefined, |
| 614 | options: { cowork?: boolean }, |
| 615 | ): Promise<void> { |
| 616 | if (options.cowork) setUseCoworkPlugins(true) |
| 617 | try { |
| 618 | if (name) { |
| 619 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 620 | console.log(`Updating marketplace: ${name}...`) |
| 621 | |
| 622 | await refreshMarketplace(name, message => { |
| 623 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 624 | console.log(message) |
| 625 | }) |
| 626 | |
| 627 | clearAllCaches() |
| 628 | |
| 629 | logEvent('ncode_marketplace_updated', { |
| 630 | marketplace_name: |
| 631 | name as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 632 | }) |
| 633 | |
| 634 | cliOk(`${figures.tick} Successfully updated marketplace: ${name}`) |
| 635 | } else { |
| 636 | const config = await loadKnownMarketplacesConfig() |
| 637 | const marketplaceNames = Object.keys(config) |
| 638 | |
| 639 | if (marketplaceNames.length === 0) { |
| 640 | cliOk('No marketplaces configured') |
| 641 | } |
| 642 | |
| 643 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 644 | console.log(`Updating ${marketplaceNames.length} marketplace(s)...`) |
| 645 | |
| 646 | await refreshAllMarketplaces() |
| 647 | clearAllCaches() |
| 648 | |
| 649 | logEvent('ncode_marketplace_updated_all', { |
| 650 | count: |
| 651 | marketplaceNames.length as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 652 | }) |
| 653 | |
| 654 | cliOk( |
| 655 | `${figures.tick} Successfully updated ${marketplaceNames.length} marketplace(s)`, |
| 656 | ) |
| 657 | } |
| 658 | } catch (error) { |
| 659 | handleMarketplaceError(error, 'update marketplace(s)') |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | // plugin install (lines 5690–5721) |
| 664 | export async function pluginInstallHandler( |
no test coverage detected