Skip to content

Commit 4e628a5

Browse files
committed
add more info to error when calling npm
1 parent af36fbf commit 4e628a5

File tree

1 file changed

+10
-4
lines changed
  • src/tools/rustdoc-gui-test/src

1 file changed

+10
-4
lines changed

src/tools/rustdoc-gui-test/src/main.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@ fn get_browser_ui_test_version_inner(npm: &Path, global: bool) -> Option<String>
1414
if global {
1515
command.arg("--global");
1616
}
17-
let lines = command
18-
.output()
19-
.map(|output| String::from_utf8_lossy(&output.stdout).into_owned())
20-
.unwrap_or(String::new());
17+
let lines = match command.output() {
18+
Ok(output) => String::from_utf8_lossy(&output.stdout).into_owned(),
19+
Err(e) => {
20+
eprintln!(
21+
"path to npm can be wrong, provided path: {npm:?}. Try to set npm path \
22+
in config.toml in [build.npm]",
23+
);
24+
panic!("{:?}", e)
25+
}
26+
};
2127
lines
2228
.lines()
2329
.find_map(|l| l.rsplit(':').next()?.strip_prefix("browser-ui-test@"))

0 commit comments

Comments
 (0)