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

Function sandbox_upload_plan

crates/openshell-cli/src/run.rs:6092–6115  ·  view source on GitHub ↗
(local_path: &Path, git_ignore: bool)

Source from the content-addressed store, hash-verified

6090}
6091
6092fn sandbox_upload_plan(local_path: &Path, git_ignore: bool) -> Result<SandboxUploadPlan> {
6093 let metadata = std::fs::symlink_metadata(local_path).map_err(|err| {
6094 if err.kind() == ErrorKind::NotFound {
6095 miette::miette!("local path does not exist: {}", local_path.display())
6096 } else {
6097 miette::miette!(
6098 "failed to inspect local upload path: {}",
6099 local_path.display()
6100 )
6101 }
6102 })?;
6103
6104 if git_ignore
6105 && !metadata.file_type().is_symlink()
6106 && let Ok((base_dir, files)) = git_sync_files(local_path)
6107 {
6108 if files.is_empty() {
6109 return Ok(SandboxUploadPlan::GitFilteredEmpty);
6110 }
6111 return Ok(SandboxUploadPlan::GitAware { base_dir, files });
6112 }
6113
6114 Ok(SandboxUploadPlan::Regular)
6115}
6116
6117fn scrub_git_env(command: &mut Command) -> &mut Command {
6118 for key in [

Calls 2

git_sync_filesFunction · 0.85
is_emptyMethod · 0.45