fix: sbx isn't copying base files in their respective directories
CI / All (ubuntu-latest) (push) Failing after 25s
CI / All (macos-latest) (push) Has been cancelled
CI / All (windows-latest) (push) Has been cancelled

This commit is contained in:
2026-07-01 18:44:07 -06:00
parent 91300c16fe
commit 3df590f276
+17 -11
View File
@@ -343,6 +343,8 @@ fn build_create_args(
let mut args = vec![ let mut args = vec![
"create".to_string(), "create".to_string(),
"--name".to_string(),
name.to_string(),
"--kit".to_string(), "--kit".to_string(),
kit_str.to_string(), kit_str.to_string(),
]; ];
@@ -357,8 +359,6 @@ fn build_create_args(
args.push(mixin_str); args.push(mixin_str);
} }
args.push("--name".to_string());
args.push(name.to_string());
args.push(SANDBOX_AGENT.to_string()); args.push(SANDBOX_AGENT.to_string());
args.push(".".to_string()); args.push(".".to_string());
@@ -370,11 +370,17 @@ fn copy_host_files(name: &str) -> Result<()> {
let home_dir = dirs::home_dir().context("Could not determine home directory")?; let home_dir = dirs::home_dir().context("Could not determine home directory")?;
if config_dir.exists() { if config_dir.exists() {
ensure_sandbox_dir(name, "/home/agent/.config")?; let sandbox_config_dir = "/home/agent/.config/coyote";
let src = format!("{}/", config_dir.display()); ensure_sandbox_dir(name, sandbox_config_dir)?;
let dest = format!("{name}:/home/agent/.config/"); let dest = format!("{name}:{sandbox_config_dir}/");
sbx_cp(&src, &dest)?; for entry in fs::read_dir(&config_dir)
chown_agent_recursive(name, "/home/agent/.config")?; .with_context(|| format!("Failed to read {}", config_dir.display()))?
{
let entry = entry?;
let path = entry.path();
sbx_cp(&path.display().to_string(), &dest)?;
}
chown_agent_recursive(name, sandbox_config_dir)?;
} else { } else {
debug!( debug!(
"Skipping config copy: {} does not exist", "Skipping config copy: {} does not exist",
@@ -643,14 +649,14 @@ mod tests {
args, args,
vec![ vec![
"create".to_string(), "create".to_string(),
"--name".to_string(),
"my-box".to_string(),
"--kit".to_string(), "--kit".to_string(),
"/cache/sbx-kit".to_string(), "/cache/sbx-kit".to_string(),
"--kit".to_string(), "--kit".to_string(),
dir_a.display().to_string(), dir_a.display().to_string(),
"--kit".to_string(), "--kit".to_string(),
dir_b.display().to_string(), dir_b.display().to_string(),
"--name".to_string(),
"my-box".to_string(),
"coyote".to_string(), "coyote".to_string(),
".".to_string(), ".".to_string(),
] ]
@@ -668,10 +674,10 @@ mod tests {
args, args,
vec![ vec![
"create".to_string(), "create".to_string(),
"--kit".to_string(),
"/cache/sbx-kit".to_string(),
"--name".to_string(), "--name".to_string(),
"box".to_string(), "box".to_string(),
"--kit".to_string(),
"/cache/sbx-kit".to_string(),
"coyote".to_string(), "coyote".to_string(),
".".to_string(), ".".to_string(),
] ]