Skip to content

Commit db726a6

Browse files
authored
Strip distro root prefix (#58)
1 parent b457453 commit db726a6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

objdiff-gui/src/jobs/objdiff.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ fn run_make_cmd(config: &BuildConfig, cwd: &Path, arg: &Path) -> Result<BuildSta
116116
Command::new(make)
117117
};
118118
if let Some(distro) = &config.selected_wsl_distro {
119+
// Strip distro root prefix \\wsl.localhost\{distro}
120+
let wsl_path_prefix = format!("\\\\wsl.localhost\\{}", distro);
121+
let cwd = match cwd.strip_prefix(wsl_path_prefix) {
122+
Ok(new_cwd) => format!("/{}", new_cwd.to_slash_lossy().as_ref()),
123+
Err(_) => cwd.to_string_lossy().to_string(),
124+
};
125+
119126
command
120127
.arg("--cd")
121128
.arg(cwd)

0 commit comments

Comments
 (0)