fix: tryfix directory creation
All checks were successful
CI / Check, test, lint (push) Successful in 27s
All checks were successful
CI / Check, test, lint (push) Successful in 27s
This commit is contained in:
@@ -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 id = Uuid::new_v4().to_string();
|
||||||
let short_id = &id[..8];
|
let short_id = &id[..8];
|
||||||
let session = format!("p-{}", short_id);
|
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 cmd_str = cmd.join(" ");
|
||||||
let cwd = std::env::current_dir()
|
let cwd = std::env::current_dir()
|
||||||
.context("failed to get current directory")?
|
.context("failed to get current directory")?
|
||||||
|
|||||||
Reference in New Issue
Block a user