We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6040d04 commit 0d7cde2Copy full SHA for 0d7cde2
1 file changed
crates/wash/src/plugin.rs
@@ -344,11 +344,16 @@ pub async fn install_plugin(
344
let plugin_path = plugins_dir.join(format!("{sanitized_name}.wasm"));
345
346
// Check if plugin already exists
347
- if plugin_path.exists() && !options.force {
348
- bail!(
349
- "Plugin '{}' already exists. Use --force option to overwrite",
350
- metadata.name
351
- );
+ if plugin_path.exists() {
+ if options.force {
+ // uninstall first, to really force clean re-install
+ uninstall_plugin(ctx, &metadata.name).await?;
+ } else {
352
+ bail!(
353
+ "Plugin '{}' already exists. Use --force option to overwrite",
354
+ metadata.name
355
+ );
356
+ }
357
}
358
// Write plugin to storage
359
tokio::fs::write(&plugin_path, &component_data)
0 commit comments