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

Function build_single_file_tar_cmd

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

Build the `tar cf - -C -- ` command used to wrap a single sandbox-side file for download. The trailing `--` is required: a sandbox-side file whose basename starts with `-` (e.g. `--checkpoint-action=...`) would otherwise be parsed by GNU tar as an option rather than a member to archive.

(parent: &str, basename: &str)

Source from the content-addressed store, hash-verified

1209/// with `-` (e.g. `--checkpoint-action=...`) would otherwise be parsed by GNU
1210/// tar as an option rather than a member to archive.
1211fn build_single_file_tar_cmd(parent: &str, basename: &str) -> String {
1212 format!(
1213 "tar cf - -C {parent} -- {name}",
1214 parent = shell_escape(parent),
1215 name = shell_escape(basename),
1216 )
1217}
1218
1219async fn sandbox_sync_down_file(
1220 session: &SshSessionConfig,

Calls

no outgoing calls