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 <conrad.irwin@gmail.com>
This commit is contained in:
marton csutora
2025-06-25 03:21:59 +00:00
committed by GitHub
co-authored by Conrad Irwin
parent 17774b17fb
commit 014f93008a
+20 -2
View File
@@ -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?;
}