diff --git a/crates/typst-cli/src/world.rs b/crates/typst-cli/src/world.rs index 60c182a7..e4f2354c 100644 --- a/crates/typst-cli/src/world.rs +++ b/crates/typst-cli/src/world.rs @@ -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; diff --git a/crates/typst-kit/src/package.rs b/crates/typst-kit/src/package.rs index 17df96ea..a2e29ef2 100644 --- a/crates/typst-kit/src/package.rs +++ b/crates/typst-kit/src/package.rs @@ -83,13 +83,6 @@ impl PackageStorage { ) -> PackageResult { 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() {