(storage, entry_key: str, root_key: str, local_root: Path)
| 2378 | |
| 2379 | |
| 2380 | async def _materialize_storage_entry(storage, entry_key: str, root_key: str, local_root: Path) -> None: |
| 2381 | rel = entry_key.removeprefix(root_key.rstrip("/") + "/") |
| 2382 | target = (local_root / rel).resolve() |
| 2383 | if not str(target).startswith(str(local_root.resolve())): |
| 2384 | return |
| 2385 | if await storage.is_dir(entry_key): |
| 2386 | target.mkdir(parents=True, exist_ok=True) |
| 2387 | for child in await storage.list_dir(entry_key): |
| 2388 | await _materialize_storage_entry(storage, child.key, root_key, local_root) |
| 2389 | return |
| 2390 | target.parent.mkdir(parents=True, exist_ok=True) |
| 2391 | target.write_bytes(await storage.read_bytes(entry_key)) |
| 2392 | |
| 2393 | |
| 2394 | async def _prepare_temp_workspace( |
no test coverage detected