Skip to content

Commit

Permalink
Strip distro root prefix (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
AetiasHax authored May 16, 2024
1 parent b457453 commit db726a6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions objdiff-gui/src/jobs/objdiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ fn run_make_cmd(config: &BuildConfig, cwd: &Path, arg: &Path) -> Result<BuildSta
Command::new(make)
};
if let Some(distro) = &config.selected_wsl_distro {
// Strip distro root prefix \\wsl.localhost\{distro}
let wsl_path_prefix = format!("\\\\wsl.localhost\\{}", distro);
let cwd = match cwd.strip_prefix(wsl_path_prefix) {
Ok(new_cwd) => format!("/{}", new_cwd.to_slash_lossy().as_ref()),
Err(_) => cwd.to_string_lossy().to_string(),
};

command
.arg("--cd")
.arg(cwd)
Expand Down

0 comments on commit db726a6

Please sign in to comment.