Skip to content

Commit bfe141e

Browse files
Fix wsl path parsing (#43295)
Closes #40286 Release Notes: - N/A --------- Co-authored-by: John Tur <[email protected]>
1 parent 4376eb8 commit bfe141e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

crates/cli/src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,13 @@ fn parse_path_in_wsl(source: &str, wsl: &str) -> Result<String> {
178178
.arg("--distribution")
179179
.arg(distro_name)
180180
.arg("--exec")
181-
.arg("wslpath")
182-
.arg("-m")
181+
.arg("realpath")
182+
.arg("-s")
183183
.arg(&source.path)
184184
.output()?;
185185

186186
let result = String::from_utf8_lossy(&output.stdout);
187-
let prefix = format!("//wsl.localhost/{}", distro_name);
188-
source.path = Path::new(result.trim().strip_prefix(&prefix).unwrap_or(&result)).to_owned();
187+
source.path = Path::new(result.trim()).to_owned();
189188

190189
Ok(source.to_string(|path| path.to_string_lossy().into_owned()))
191190
}

0 commit comments

Comments
 (0)