Skip to content

Commit 35c0661

Browse files
authored
Merge pull request #21088 from osdyne/fix-tool-path
Fix trailing newline in tool_path
2 parents 52dcd8b + cdc3266 commit 35c0661

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

crates/project-model/src/sysroot.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,12 @@ impl Sysroot {
192192

193193
cmd.arg("which");
194194
cmd.arg(tool.name());
195-
(|| Some(Utf8PathBuf::from(String::from_utf8(cmd.output().ok()?.stdout).ok()?)))()
196-
.unwrap_or_else(|| Utf8PathBuf::from(tool.name()))
195+
(|| {
196+
Some(Utf8PathBuf::from(
197+
String::from_utf8(cmd.output().ok()?.stdout).ok()?.trim_end(),
198+
))
199+
})()
200+
.unwrap_or_else(|| Utf8PathBuf::from(tool.name()))
197201
}
198202
_ => tool.path(),
199203
}

0 commit comments

Comments
 (0)