(
dir: &Path,
files: &BTreeMap<String, Vec<u8>>,
)
| 465 | } |
| 466 | |
| 467 | fn write_materialized_files( |
| 468 | dir: &Path, |
| 469 | files: &BTreeMap<String, Vec<u8>>, |
| 470 | ) -> Result<(), RepositoryError> { |
| 471 | std::fs::create_dir_all(dir)?; |
| 472 | for (path, bytes) in files { |
| 473 | let target = dir.join(path); |
| 474 | if let Some(parent) = target.parent() { |
| 475 | std::fs::create_dir_all(parent)?; |
| 476 | } |
| 477 | std::fs::write(target, bytes)?; |
| 478 | } |
| 479 | Ok(()) |
| 480 | } |
| 481 | |
| 482 | /// Materialize a view's visible file content into `dir` (created if needed). |
| 483 | /// |