MCPcopy Index your code
hub / github.com/codeaashu/claude-code / updatePluginCli

Function updatePluginCli

src/services/plugins/pluginCliCommands.ts:300–344  ·  view source on GitHub ↗
(
  plugin: string,
  scope: PluginScope,
)

Source from the content-addressed store, hash-verified

298 * @param scope Scope to update
299 */
300export async function updatePluginCli(
301 plugin: string,
302 scope: PluginScope,
303): Promise<void> {
304 try {
305 writeToStdout(
306 `Checking for updates for plugin "${plugin}" at ${scope} scope…\n`,
307 )
308
309 const result = await updatePluginOp(plugin, scope)
310
311 if (!result.success) {
312 throw new Error(result.message)
313 }
314
315 writeToStdout(`${figures.tick} ${result.message}\n`)
316
317 if (!result.alreadyUpToDate) {
318 const { name, marketplace } = parsePluginIdentifier(
319 result.pluginId || plugin,
320 )
321 logEvent('tengu_plugin_updated_cli', {
322 _PROTO_plugin_name:
323 name as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
324 ...(marketplace && {
325 _PROTO_marketplace_name:
326 marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
327 }),
328 old_version: (result.oldVersion ||
329 'unknown') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
330 new_version: (result.newVersion ||
331 'unknown') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
332 ...buildPluginTelemetryFields(
333 name,
334 marketplace,
335 getManagedPluginNames(),
336 ),
337 })
338 }
339
340 await gracefulShutdown(0)
341 } catch (error) {
342 handlePluginCommandError(error, 'update', plugin)
343 }
344}
345

Callers 1

pluginUpdateHandlerFunction · 0.85

Calls 8

writeToStdoutFunction · 0.85
updatePluginOpFunction · 0.85
parsePluginIdentifierFunction · 0.85
logEventFunction · 0.85
getManagedPluginNamesFunction · 0.85
gracefulShutdownFunction · 0.85
handlePluginCommandErrorFunction · 0.85

Tested by

no test coverage detected