fix: tryfix directory creation
All checks were successful
CI / Check, test, lint (push) Successful in 27s

This commit is contained in:
2026-05-20 11:35:39 +02:00
parent 7f0574a1a5
commit 6a4c5d41a1

View File

@@ -16,8 +16,16 @@ pub fn execute(worker_name: Option<&str>, cmd: Vec<String>, no_sync: bool) -> Re
let id = Uuid::new_v4().to_string();
let short_id = &id[..8];
let session = format!("p-{}", short_id);
let job_dir = format!("~/.p/jobs/{}", id);
let work_dir = format!("~/.p/workdirs/{}", id);
// Resolve the remote home directory once using an absolute path so that
// every subsequent call — SSH, rsync, and scripts on the worker — all
// operate on the same concrete path with no ~ expansion ambiguity.
let remote_home =
ssh::run_capture(&worker, "echo $HOME").context("failed to connect to worker")?;
let remote_home = remote_home.trim();
let job_dir = format!("{}/.p/jobs/{}", remote_home, id);
let work_dir = format!("{}/.p/workdirs/{}", remote_home, id);
let cmd_str = cmd.join(" ");
let cwd = std::env::current_dir()
.context("failed to get current directory")?