fix(cli.rs): info version checks not striping \r on Windows (#1952)

This commit is contained in:
Lucas Fernandes Nogueira 2021-06-05 09:23:09 -03:00 committed by GitHub
parent dc6b0d8522
commit 6a95d7acc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"cli.rs": patch
---
Fixes `info` command not striping `\r` from child process version output.

View File

@ -206,7 +206,11 @@ fn get_version(command: &str, args: &[&str]) -> crate::Result<Option<String>> {
let output = cmd.args(args).arg("--version").output()?;
let version = if output.status.success() {
Some(String::from_utf8_lossy(&output.stdout).replace("\n", ""))
Some(
String::from_utf8_lossy(&output.stdout)
.replace("\n", "")
.replace("\r", ""),
)
} else {
None
};