vendor highest prio when searching

This commit is contained in:
stelzo 2025-01-22 18:05:54 +01:00
parent a87b426e66
commit c8e838036b
No known key found for this signature in database
GPG Key ID: FC4EF89052319374
2 changed files with 7 additions and 8 deletions

View File

@ -383,7 +383,6 @@ fn system_path(
// will be resolved.
let buf;
let mut root = project_root;
if let Some(spec) = id.package() {
buf = package_storage.prepare_package(spec, &mut PrintDownload(&spec))?;
root = &buf;

View File

@ -83,13 +83,6 @@ impl PackageStorage {
) -> PackageResult<PathBuf> {
let subdir = format!("{}/{}/{}", spec.namespace, spec.name, spec.version);
if let Some(packages_dir) = &self.package_path {
let dir = packages_dir.join(&subdir);
if dir.exists() {
return Ok(dir);
}
}
// Read from vendor dir if it exists.
if let Some(vendor_dir) = &self.package_vendor_path {
if let Ok(true) = vendor_dir.try_exists() {
@ -100,6 +93,13 @@ impl PackageStorage {
}
}
if let Some(packages_dir) = &self.package_path {
let dir = packages_dir.join(&subdir);
if dir.exists() {
return Ok(dir);
}
}
if let Some(cache_dir) = &self.package_cache_path {
let dir = cache_dir.join(&subdir);
if dir.exists() {