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

Function sandbox_sync_up_files

crates/openshell-cli/src/ssh.rs:943–967  ·  view source on GitHub ↗

Push a list of files from a local directory into a sandbox using tar-over-SSH. Files are streamed as a tar archive to `ssh ... tar xf - -C ` on the sandbox side. When `dest` is `None`, files are uploaded to the sandbox user's home directory.

(
    server: &str,
    name: &str,
    base_dir: &Path,
    files: &[String],
    local_path: &Path,
    dest: Option<&str>,
    tls: &TlsOptions,
)

Source from the content-addressed store, hash-verified

941/// the sandbox side. When `dest` is `None`, files are uploaded to the
942/// sandbox user's home directory.
943pub async fn sandbox_sync_up_files(
944 server: &str,
945 name: &str,
946 base_dir: &Path,
947 files: &[String],
948 local_path: &Path,
949 dest: Option<&str>,
950 tls: &TlsOptions,
951) -> Result<()> {
952 if files.is_empty() {
953 return Ok(());
954 }
955 ssh_tar_upload(
956 server,
957 name,
958 dest,
959 UploadSource::FileList {
960 base_dir: base_dir.to_path_buf(),
961 files: files.to_vec(),
962 archive_prefix: file_list_archive_prefix(local_path),
963 },
964 tls,
965 )
966 .await
967}
968
969/// Push a local path (file or directory) into a sandbox using tar-over-SSH.
970///

Callers 2

mainFunction · 0.85
sandbox_createFunction · 0.85

Calls 3

ssh_tar_uploadFunction · 0.85
file_list_archive_prefixFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected