diff --git a/src/config/mod.rs b/src/config/mod.rs index d5381f499..f895795fc 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -133,7 +133,9 @@ impl Config { pub fn ensure_installed(&self) -> Result<()> { for rtv in self.ts.list_current_versions() { - if rtv.plugin.is_installed() { + eprintln!("Ensuring {} is installed {}", rtv.plugin.name , rtv.version); + let source = self.ts.get_source_for_plugin(&rtv.plugin.name); + if rtv.plugin.is_installed() || matches!(source, Some(PluginSource::Argument(_))) { rtv.ensure_installed(self)?; } } diff --git a/src/runtimes/mod.rs b/src/runtimes/mod.rs index a2b5419b7..43f2ab9bb 100644 --- a/src/runtimes/mod.rs +++ b/src/runtimes/mod.rs @@ -135,6 +135,9 @@ impl RuntimeVersion { if self.is_installed() || self.version == "system" { return Ok(true); } + if !self.plugin.ensure_installed(&config.settings)? { + return Ok(false); + } match config.settings.missing_runtime_behavior { MissingRuntimeBehavior::AutoInstall => { self.install(InstallType::Version, config)?;