Skip to main content

remove_plugins

Function remove_plugins 

Source
pub fn remove_plugins(
    names: &[String],
    delete_files: bool,
    allow_external_delete: bool,
    config: &MarketplaceConfig,
) -> Result<RemoveResult, SoukError>
Expand description

Removes the named plugins from the marketplace.

For each name in names:

  • Finds the matching entry in marketplace.json
  • If delete_files is true, also removes the plugin directory from disk
  • Bumps the marketplace version (patch)

Returns a RemoveResult with the removed names and any warnings (e.g., if a directory could not be deleted after the marketplace entry was removed).

§Errors

Returns SoukError::PluginNotFound if any name does not exist in the marketplace.

Returns SoukError::AtomicRollback if the post-removal validation fails.

§Example

let result = remove_plugins(
    &["my-plugin".to_string()],
    true,  // delete files
    false, // don't allow external deletes
    config,
).unwrap();

for name in &result.removed {
    println!("Removed: {name}");
}
for warn in &result.warnings {
    eprintln!("Warning: {warn}");
}