diff --git a/src/cli/args/backend_arg.rs b/src/cli/args/backend_arg.rs index 04fcfa50c7..a62f33db0d 100644 --- a/src/cli/args/backend_arg.rs +++ b/src/cli/args/backend_arg.rs @@ -179,6 +179,8 @@ impl BackendArg { let opts_str = opts .opts .iter() + // filter out global options that are only relevant for initial installation + .filter(|(k, _)| !["postinstall", "install_env"].contains(&k.as_str())) .map(|(k, v)| format!("{k}={v}")) .collect::>() .join(","); diff --git a/src/toolset/install_state.rs b/src/toolset/install_state.rs index b7e614b532..385de15e1b 100644 --- a/src/toolset/install_state.rs +++ b/src/toolset/install_state.rs @@ -222,10 +222,16 @@ fn read_backend_meta(short: &str) -> Option> { } pub fn write_backend_meta(ba: &BackendArg) -> Result<()> { - // do not write options for core plugins - let full = match ba.full().starts_with("core:") { - true => ba.full(), - false => ba.full_with_opts(), + // only use full_with_opts for specific plugin prefixes + let full = match ba.full() { + full if full.starts_with("cargo:") + || full.starts_with("go:") + || full.starts_with("pipx:") + || full.starts_with("ubi:") => + { + ba.full_with_opts() + } + _ => ba.full(), }; let doc = format!("{}\n{}", ba.short, full); file::write(backend_meta_path(&ba.short), doc.trim())?;