(path: &Path, dst: &Path)
| 255 | } |
| 256 | |
| 257 | fn cp_r(path: &Path, dst: &Path) -> Result<()> { |
| 258 | fs::create_dir(dst)?; |
| 259 | for entry in path.read_dir()? { |
| 260 | let entry = entry?; |
| 261 | let path = entry.path(); |
| 262 | let dst = dst.join(entry.file_name()); |
| 263 | if entry.file_type()?.is_dir() { |
| 264 | cp_r(&path, &dst)?; |
| 265 | } else { |
| 266 | fs::copy(&path, &dst)?; |
| 267 | } |
| 268 | } |
| 269 | Ok(()) |
| 270 | } |
| 271 | |
| 272 | #[derive(Debug, Default, Deserialize)] |
| 273 | struct Spec { |