Skip to main content

update_plugin_op

Function update_plugin_op 

Source
pub async fn update_plugin_op(plugin: &str, scope: &str) -> PluginUpdateResult
Expand description

Update a plugin to the latest version.

This function performs a NON-INPLACE update:

  1. Gets the plugin info from the marketplace
  2. For remote plugins: downloads to temp dir and calculates version
  3. For local plugins: calculates version from marketplace source
  4. If version differs from currently installed, copies to new versioned cache directory
  5. Updates installation in V2 file (memory stays unchanged until restart)
  6. Cleans up old version if no longer referenced by any installation

§Arguments

  • plugin - Plugin name or plugin@marketplace identifier
  • scope - Scope to update. Unlike install/uninstall/enable/disable, managed scope IS allowed.

§Returns

Result indicating success/failure with version info