From 353e936a7a521f59094335f578a729a61913b858 Mon Sep 17 00:00:00 2001 From: Julia Ryan Date: Wed, 15 Oct 2025 19:38:08 -0700 Subject: [PATCH] Fix mkdir nushell flags (#40306) Closes #40269 Release Notes: - N/A --- crates/remote/src/transport/wsl.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/remote/src/transport/wsl.rs b/crates/remote/src/transport/wsl.rs index 5d6dadb7adc11331938dd6e4f895877aa8dc3802..f5a86fd16f0b630bedcb7a325eaacd23eae0ca15 100644 --- a/crates/remote/src/transport/wsl.rs +++ b/crates/remote/src/transport/wsl.rs @@ -82,7 +82,7 @@ impl WslRemoteConnection { this.can_exec = this.detect_can_exec(shell).await?; this.platform = this.detect_platform(shell).await?; this.remote_binary_path = Some( - this.ensure_server_binary(&delegate, release_channel, version, commit, cx) + this.ensure_server_binary(&delegate, release_channel, version, commit, shell, cx) .await?, ); log::debug!("Detected WSL environment: {this:#?}"); @@ -163,6 +163,7 @@ impl WslRemoteConnection { release_channel: ReleaseChannel, version: SemanticVersion, commit: Option, + shell: ShellKind, cx: &mut AsyncApp, ) -> Result> { let version_str = match release_channel { @@ -184,9 +185,13 @@ impl WslRemoteConnection { paths::remote_wsl_server_dir_relative().join(RelPath::unix(&binary_name).unwrap()); if let Some(parent) = dst_path.parent() { - self.run_wsl_command("mkdir", &["-p", &parent.display(PathStyle::Posix)]) - .await - .map_err(|e| anyhow!("Failed to create directory: {}", e))?; + let parent = parent.display(PathStyle::Posix); + if shell == ShellKind::Nushell { + self.run_wsl_command("mkdir", &[&parent]).await + } else { + self.run_wsl_command("mkdir", &["-p", &parent]).await + } + .map_err(|e| anyhow!("Failed to create directory: {}", e))?; } #[cfg(debug_assertions)]