| 299 | |
| 300 | #[tracing::instrument(level = "debug", skip(self))] |
| 301 | fn find_extension_manifests(&self) -> Vec<PathBuf> { |
| 302 | let mut package_json_paths = Vec::new(); |
| 303 | |
| 304 | if let Ok(entries) = fs::read_dir(self.extensions_path.clone()) { |
| 305 | for entry in entries.flatten() { |
| 306 | let path = entry.path(); |
| 307 | if path.is_dir() { |
| 308 | // Check only the first level subdirectories |
| 309 | if let Ok(sub_entries) = fs::read_dir(&path) { |
| 310 | for sub_entry in sub_entries.flatten() { |
| 311 | let sub_path = sub_entry.path(); |
| 312 | if sub_path.is_file() |
| 313 | && sub_path.file_name() == Some("package.json".as_ref()) |
| 314 | { |
| 315 | package_json_paths.push(sub_path); |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | } else if path.is_file() && path.file_name() == Some("package.json".as_ref()) { |
| 320 | package_json_paths.push(path); |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | package_json_paths |
| 325 | } |
| 326 | |
| 327 | #[tracing::instrument(level = "debug", skip(self))] |
| 328 | async fn find_extensions(&self) -> Vec<ExtensionManifest> { |