mirror of
https://github.com/typst/typst
synced 2025-07-27 22:37:54 +08:00
One comment out of date
This commit is contained in:
parent
efe81a1aae
commit
143732d2a8
@ -111,13 +111,13 @@ impl PackageStorage {
|
|||||||
// None of the strategies above found the package, so all code paths
|
// None of the strategies above found the package, so all code paths
|
||||||
// from now on fail. The rest of the function is only to determine the
|
// from now on fail. The rest of the function is only to determine the
|
||||||
// cause of the failure.
|
// cause of the failure.
|
||||||
|
// We try `namespace/` then `namespace/name/` then `namespace/name/version/`
|
||||||
|
// and see where the first error occurs.
|
||||||
let not_found = |msg| Err(PackageError::NotFound(spec.clone(), msg));
|
let not_found = |msg| Err(PackageError::NotFound(spec.clone(), msg));
|
||||||
|
|
||||||
let Some(packages_dir) = &self.package_path else {
|
let Some(packages_dir) = &self.package_path else {
|
||||||
return not_found(eco_format!("cannot access local package storage"));
|
return not_found(eco_format!("cannot access local package storage"));
|
||||||
};
|
};
|
||||||
// Fast path failed. Instead we try to diagnose the issue by going
|
|
||||||
// down the subdirectories of the expected path one at a time.
|
|
||||||
let namespace_dir = packages_dir.join(format!("{}", spec.namespace));
|
let namespace_dir = packages_dir.join(format!("{}", spec.namespace));
|
||||||
if !namespace_dir.exists() {
|
if !namespace_dir.exists() {
|
||||||
return not_found(eco_format!(
|
return not_found(eco_format!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user