Skip to content

Commit 6a95d7a

Browse files
authored
fix(cli.rs): info version checks not striping \r on Windows (#1952)
1 parent dc6b0d8 commit 6a95d7a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Diff for: .changes/fix-windows-info-cmd.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"cli.rs": patch
3+
---
4+
5+
Fixes `info` command not striping `\r` from child process version output.

Diff for: tooling/cli.rs/src/info.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,11 @@ fn get_version(command: &str, args: &[&str]) -> crate::Result<Option<String>> {
206206

207207
let output = cmd.args(args).arg("--version").output()?;
208208
let version = if output.status.success() {
209-
Some(String::from_utf8_lossy(&output.stdout).replace("\n", ""))
209+
Some(
210+
String::from_utf8_lossy(&output.stdout)
211+
.replace("\n", "")
212+
.replace("\r", ""),
213+
)
210214
} else {
211215
None
212216
};

0 commit comments

Comments
 (0)