Skip to content

Commit fb1cc56

Browse files
committed
Fix mkdir nushell flags (zed-industries#40306)
Closes zed-industries#40269 Release Notes: - N/A
1 parent 88eac84 commit fb1cc56

File tree

1 file changed

+9
-4
lines changed
  • crates/remote/src/transport

1 file changed

+9
-4
lines changed

crates/remote/src/transport/wsl.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl WslRemoteConnection {
8282
this.can_exec = this.detect_can_exec(shell).await?;
8383
this.platform = this.detect_platform(shell).await?;
8484
this.remote_binary_path = Some(
85-
this.ensure_server_binary(&delegate, release_channel, version, commit, cx)
85+
this.ensure_server_binary(&delegate, release_channel, version, commit, shell, cx)
8686
.await?,
8787
);
8888
log::debug!("Detected WSL environment: {this:#?}");
@@ -163,6 +163,7 @@ impl WslRemoteConnection {
163163
release_channel: ReleaseChannel,
164164
version: SemanticVersion,
165165
commit: Option<AppCommitSha>,
166+
shell: ShellKind,
166167
cx: &mut AsyncApp,
167168
) -> Result<Arc<RelPath>> {
168169
let version_str = match release_channel {
@@ -184,9 +185,13 @@ impl WslRemoteConnection {
184185
paths::remote_wsl_server_dir_relative().join(RelPath::unix(&binary_name).unwrap());
185186

186187
if let Some(parent) = dst_path.parent() {
187-
self.run_wsl_command("mkdir", &["-p", &parent.display(PathStyle::Posix)])
188-
.await
189-
.map_err(|e| anyhow!("Failed to create directory: {}", e))?;
188+
let parent = parent.display(PathStyle::Posix);
189+
if shell == ShellKind::Nushell {
190+
self.run_wsl_command("mkdir", &[&parent]).await
191+
} else {
192+
self.run_wsl_command("mkdir", &["-p", &parent]).await
193+
}
194+
.map_err(|e| anyhow!("Failed to create directory: {}", e))?;
190195
}
191196

192197
#[cfg(debug_assertions)]

0 commit comments

Comments
 (0)