diff --git a/crates/remote/src/ssh_session.rs b/crates/remote/src/ssh_session.rs index 660e562780..ffcf3b3783 100644 --- a/crates/remote/src/ssh_session.rs +++ b/crates/remote/src/ssh_session.rs @@ -1805,7 +1805,16 @@ impl SshRemoteConnection { ) -> Result<()> { if let Some(parent) = tmp_path_gz.parent() { self.socket - .run_command("mkdir", &["-p", &parent.to_string_lossy()]) + .run_command( + "sh", + &[ + "-c", + &shell_script!( + "mkdir -p {parent}", + parent = parent.to_string_lossy().as_ref() + ), + ], + ) .await?; } @@ -1877,7 +1886,16 @@ impl SshRemoteConnection { ) -> Result<()> { if let Some(parent) = tmp_path_gz.parent() { self.socket - .run_command("mkdir", &["-p", &parent.to_string_lossy()]) + .run_command( + "sh", + &[ + "-c", + &shell_script!( + "mkdir -p {parent}", + parent = parent.to_string_lossy().as_ref() + ), + ], + ) .await?; }