diff --git a/Cargo.lock b/Cargo.lock index ad744f9..cc806e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,7 +140,7 @@ dependencies = [ [[package]] name = "cargo-outdated" -version = "0.9.9" +version = "0.9.10" dependencies = [ "anyhow", "cargo", diff --git a/Cargo.toml b/Cargo.toml index 85893f8..2a2d0dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-outdated" -version = "0.9.9" +version = "0.9.10" authors = [ "Kevin K. ", "Frederick Z. ", diff --git a/src/cargo_ops/temp_project.rs b/src/cargo_ops/temp_project.rs index 24ccf06..e147789 100644 --- a/src/cargo_ops/temp_project.rs +++ b/src/cargo_ops/temp_project.rs @@ -654,13 +654,17 @@ fn manifest_paths(elab: &ElaborateWorkspace<'_>) -> CargoResult> { visited.insert(pkg_id); let pkg = &elab.pkgs[&pkg_id]; let pkg_path = pkg.root().to_string_lossy(); + + // Checking if there's a CARGO_HOME set and that it is not an empty string let cargo_home_path = match std::env::var_os("CARGO_HOME") { - Some(path) => path.into_string().expect("Error getting string from OsString"), - None => "".to_string(), + Some(path) if !path.is_empty() => Some(path.into_string().expect("Error getting string from OsString")), + _ => None, }; + // If there is a CARGO_HOME make sure we do not crawl the registry for more Cargo.toml files + // Otherwise add all Cargo.toml files to the manifest paths if pkg_path.starts_with(workspace_path) { - if !pkg_path.starts_with(&cargo_home_path){ + if cargo_home_path.is_none() || !pkg_path.starts_with(&cargo_home_path.expect("Error extracting CARGO_HOME string")) { manifest_paths.push(pkg.manifest_path().to_owned()); } }