mirror of
https://github.com/typst/typst
synced 2025-05-16 18:15:29 +08:00
vendor highest prio when searching
This commit is contained in:
parent
a87b426e66
commit
c8e838036b
@ -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;
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user