MCPcopy Create free account
hub / github.com/dada-lang/dada / copy_dir_recursive

Function copy_dir_recursive

components/xtask/src/deploy.rs:144–160  ·  view source on GitHub ↗
(src: &PathBuf, dst: &PathBuf)

Source from the content-addressed store, hash-verified

142}
143
144fn copy_dir_recursive(src: &PathBuf, dst: &PathBuf) -> anyhow::Result<()> {
145 std::fs::create_dir_all(dst)?;
146
147 for entry in std::fs::read_dir(src)? {
148 let entry = entry?;
149 let src_path = entry.path();
150 let dst_path = dst.join(entry.file_name());
151
152 if src_path.is_dir() {
153 copy_dir_recursive(&src_path, &dst_path)?;
154 } else {
155 std::fs::copy(&src_path, &dst_path)?;
156 }
157 }
158
159 Ok(())
160}

Callers 1

mainMethod · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected