(
archive: &mut tar::Builder<W>,
local_path: &Path,
archive_path: &Path,
)
| 687 | } |
| 688 | |
| 689 | fn append_upload_dir_contents<W: Write>( |
| 690 | archive: &mut tar::Builder<W>, |
| 691 | local_path: &Path, |
| 692 | archive_path: &Path, |
| 693 | ) -> Result<()> { |
| 694 | let mut entries = fs::read_dir(local_path) |
| 695 | .into_diagnostic() |
| 696 | .wrap_err_with(|| format!("failed to read directory {}", local_path.display()))? |
| 697 | .collect::<std::io::Result<Vec<_>>>() |
| 698 | .into_diagnostic() |
| 699 | .wrap_err_with(|| format!("failed to read directory {}", local_path.display()))?; |
| 700 | entries.sort_by_key(fs::DirEntry::file_name); |
| 701 | |
| 702 | for entry in entries { |
| 703 | let child_local_path = entry.path(); |
| 704 | let child_archive_path = archive_path.join(entry.file_name()); |
| 705 | append_upload_path(archive, &child_local_path, &child_archive_path, false)?; |
| 706 | } |
| 707 | |
| 708 | Ok(()) |
| 709 | } |
| 710 | |
| 711 | fn append_upload_symlink<W: Write>( |
| 712 | archive: &mut tar::Builder<W>, |
no test coverage detected