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

Function directory_upload_prefix

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

Compute the tar entry prefix for a directory upload. Returns the directory's basename for any path with a meaningful basename; callers extracting at ` ` will see contents wrapped under ` / /...`. Returns `"."` for paths without a basename (e.g. `.` or `/`), which produces flat extraction at ` `.

(local_path: &Path)

Source from the content-addressed store, hash-verified

1043/// `<dest>/<basename>/...`. Returns `"."` for paths without a basename
1044/// (e.g. `.` or `/`), which produces flat extraction at `<dest>`.
1045fn directory_upload_prefix(local_path: &Path) -> std::ffi::OsString {
1046 local_path
1047 .file_name()
1048 .map_or_else(|| ".".into(), std::ffi::OsStr::to_os_string)
1049}
1050
1051fn file_list_archive_prefix(local_path: &Path) -> Option<PathBuf> {
1052 if !local_path.is_dir() {

Callers 2

sandbox_sync_upFunction · 0.85
file_list_archive_prefixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected