MCPcopy Create free account
hub / github.com/AI45Lab/Code / local_path_for_write

Method local_path_for_write

core/src/workspace/local.rs:53–72  ·  view source on GitHub ↗
(&self, path: &WorkspacePath)

Source from the content-addressed store, hash-verified

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
75impl WorkspacePathResolver for LocalWorkspaceBackend {

Callers 1

write_textMethod · 0.80

Calls 3

is_rootMethod · 0.80
cloneMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected