Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fixed nushell error when creating new folder when uploading wsl-remote-server (#40432)
kingananas20cd51efad9e70
diff --git a/crates/remote/src/transport/wsl.rs b/crates/remote/src/transport/wsl.rsindex f5a86fd16f0..a2ed840a95f 100644--- a/crates/remote/src/transport/wsl.rs+++ b/crates/remote/src/transport/wsl.rs@@ -206,7 +206,7 @@ impl WslRemoteConnection {)).unwrap(),);- self.upload_file(&remote_server_path, &tmp_path, delegate, cx)+ self.upload_file(&remote_server_path, &tmp_path, delegate, &shell, cx).await?;self.extract_and_install(&tmp_path, &dst_path, delegate, cx).await?;@@ -239,7 +239,8 @@ impl WslRemoteConnection {);let tmp_path = RelPath::unix(&tmp_path).unwrap();- self.upload_file(&src_path, &tmp_path, delegate, cx).await?;+ self.upload_file(&src_path, &tmp_path, delegate, &shell, cx)+ .await?;self.extract_and_install(&tmp_path, &dst_path, delegate, cx).await?;@@ -251,14 +252,19 @@ impl WslRemoteConnection {src_path: &Path,dst_path: &RelPath,delegate: &Arc<dyn RemoteClientDelegate>,+ shell: &ShellKind,cx: &mut AsyncApp,) -> Result<()> {delegate.set_status(Some("Uploading remote server to WSL"), cx);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 when uploading file: {}", 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 when uploading file: {}", e))?;}let t0 = Instant::now();