1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-05-31 23:50:52 +00:00

fix(ocaml): Stop new line being included in ocaml version (#1479)

This fixes a regression in the ocaml module that caused the excess whitespace
to not be trimmed from the version.
This commit is contained in:
Thomas O'Donnell 2020-07-15 23:22:40 +02:00 committed by GitHub
parent 133574ab09
commit 15bc9fa210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -50,7 +50,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
_ => None,
})
.map(|variable| match variable {
"version" => Some(Ok(format!("v{}", &ocaml_version))),
"version" => Some(Ok(format!("v{}", &ocaml_version.trim()))),
_ => None,
})
.parse(None)

View File

@ -84,11 +84,11 @@ active boot switches: -d:release\n",
stderr: String::default(),
}),
"ocaml -vnum" => Some(CommandOutput {
stdout: String::from("4.10.0"),
stdout: String::from("4.10.0\n"),
stderr: String::default(),
}),
"esy ocaml -vnum" => Some(CommandOutput {
stdout: String::from("4.08.1"),
stdout: String::from("4.08.1\n"),
stderr: String::default(),
}),
"php -nr echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION;" => {