From d3f2d0cae0c8b19c7036d068b805832be8b163cb Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 16 Aug 2022 11:52:43 -0700 Subject: [PATCH] rustbuild: fix version parsing for browser-ui-test --- src/bootstrap/test.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index baad0c75295a..242ad98813d7 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -905,7 +905,10 @@ fn get_browser_ui_test_version_inner(npm: &Path, global: bool) -> Option .output() .map(|output| String::from_utf8_lossy(&output.stdout).into_owned()) .unwrap_or(String::new()); - lines.lines().find_map(|l| l.split(":browser-ui-test@").skip(1).next()).map(|v| v.to_owned()) + lines + .lines() + .find_map(|l| l.split(':').nth(1)?.strip_prefix("browser-ui-test@")) + .map(|v| v.to_owned()) } fn get_browser_ui_test_version(npm: &Path) -> Option {