(src: &PathBuf, dst: &PathBuf)
| 142 | } |
| 143 | |
| 144 | fn 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 | } |