Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only Upgrade Plugins if Needed #230

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions coffee_core/src/coffee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,18 @@ impl PluginManager for CoffeeManager {
.ok_or_else(|| error!("Repository with name: `{}` not found", repo))?;

let status = repository.upgrade(&self.config.plugins, verbose).await?;
for plugins in status.plugins_effected.iter() {
self.remove(plugins).await?;
self.install(plugins, verbose, false).await?;

// if status is not up to date, we need to update the plugins as well
match status.status {
UpgradeStatus::Updated(_, _) => {
for plugins in status.plugins_effected.iter() {
self.remove(plugins).await?;
self.install(plugins, verbose, false).await?;
}
}
_ => {}
}

self.flush().await?;
Ok(status)
}
Expand Down
Loading