(&self, path: &WorkspacePath)
| 51 | } |
| 52 | |
| 53 | fn local_path_for_write(&self, path: &WorkspacePath) -> Result<PathBuf> { |
| 54 | let target = if path.is_root() { |
| 55 | self.root.clone() |
| 56 | } else { |
| 57 | self.root.join(path.as_str()) |
| 58 | }; |
| 59 | |
| 60 | if let Some(parent) = target.parent() { |
| 61 | std::fs::create_dir_all(parent).map_err(|e| { |
| 62 | anyhow!( |
| 63 | "Failed to create parent directories for {}: {}", |
| 64 | target.display(), |
| 65 | e |
| 66 | ) |
| 67 | })?; |
| 68 | } |
| 69 | |
| 70 | a3s_common::tools::resolve_path_for_write(&self.root, path.as_str()) |
| 71 | .map_err(|e| anyhow!("{}", e)) |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | impl WorkspacePathResolver for LocalWorkspaceBackend { |
no test coverage detected