MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / write_tree

Function write_tree

atomic-cli/tests/it/graph_only_export_cb9b_test.rs:184–190  ·  view source on GitHub ↗
(root: &Path, files: &[(&str, Vec<u8>)])

Source from the content-addressed store, hash-verified

182];
183
184fn write_tree(root: &Path, files: &[(&str, Vec<u8>)]) {
185 for (path, bytes) in files {
186 let dest = root.join(path);
187 fs::create_dir_all(dest.parent().unwrap()).unwrap();
188 fs::write(dest, bytes).unwrap();
189 }
190}
191
192fn file_bytes(path: &str, base: &str) -> Vec<u8> {
193 format!("// {path}\n{base}\n").into_bytes()

Calls 3

parentMethod · 0.80
writeFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected