mirror of
https://github.com/typst/typst
synced 2025-05-17 02:25:27 +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.
|
// will be resolved.
|
||||||
let buf;
|
let buf;
|
||||||
let mut root = project_root;
|
let mut root = project_root;
|
||||||
|
|
||||||
if let Some(spec) = id.package() {
|
if let Some(spec) = id.package() {
|
||||||
buf = package_storage.prepare_package(spec, &mut PrintDownload(&spec))?;
|
buf = package_storage.prepare_package(spec, &mut PrintDownload(&spec))?;
|
||||||
root = &buf;
|
root = &buf;
|
||||||
|
@ -83,13 +83,6 @@ impl PackageStorage {
|
|||||||
) -> PackageResult<PathBuf> {
|
) -> PackageResult<PathBuf> {
|
||||||
let subdir = format!("{}/{}/{}", spec.namespace, spec.name, spec.version);
|
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.
|
// Read from vendor dir if it exists.
|
||||||
if let Some(vendor_dir) = &self.package_vendor_path {
|
if let Some(vendor_dir) = &self.package_vendor_path {
|
||||||
if let Ok(true) = vendor_dir.try_exists() {
|
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 {
|
if let Some(cache_dir) = &self.package_cache_path {
|
||||||
let dir = cache_dir.join(&subdir);
|
let dir = cache_dir.join(&subdir);
|
||||||
if dir.exists() {
|
if dir.exists() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user