From 014f93008a3df942b2cd2c598a73d1c800f51f53 Mon Sep 17 00:00:00 2001 From: marton csutora Date: Wed, 25 Jun 2025 05:21:59 +0200 Subject: [PATCH] Make remote mkdir shell-independent for compatibility (#32997) - Closes: #30962 Nushell does not support mkdir -p So invoke sh -c "mkdir -p" instead which will also work under nushell. Release Notes: - Fixed ssh remotes running Nushell (and possibly other non posix-compliant shells) --------- Co-authored-by: Conrad Irwin --- crates/remote/src/ssh_session.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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?; }