MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / append_upload_dir_contents

Function append_upload_dir_contents

crates/openshell-cli/src/ssh.rs:689–709  ·  view source on GitHub ↗
(
    archive: &mut tar::Builder<W>,
    local_path: &Path,
    archive_path: &Path,
)

Source from the content-addressed store, hash-verified

687}
688
689fn 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
711fn append_upload_symlink<W: Write>(
712 archive: &mut tar::Builder<W>,

Callers 1

append_upload_pathFunction · 0.85

Calls 2

append_upload_pathFunction · 0.85
pathMethod · 0.80

Tested by

no test coverage detected