Skip to content

Commit

Permalink
fix: check for duplicated plugins
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Mar 1, 2024
1 parent 6efaf27 commit f0cdfc3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions coffee_core/src/coffee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ impl PluginManager for CoffeeManager {
verbose: bool,
try_dynamic: bool,
) -> Result<(), CoffeeError> {
let mut plugins = self.config.plugins.clone();
plugins.retain(|p| p.name().eq(plugin));

if !plugins.is_empty() {
return Err(error!("Plugin with name `{plugin}` already installed"));
}

log::debug!("installing plugin: {plugin}");
// keep track if the plugin is successfully installed
for repo in self.repos.values() {
Expand Down

0 comments on commit f0cdfc3

Please sign in to comment.