diff options
| author | klensy <klensy@users.noreply.github.com> | 2023-06-12 22:00:08 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2023-06-12 22:00:08 +0300 |
| commit | 4e628a516a7c4f40b2fbecec580a2a41d6e60d89 (patch) | |
| tree | bbd917e325ef71bba3f8c3d26bb48dd6e0a34b26 | |
| parent | af36fbfc336f176a43a42addfaa12d48163b7e12 (diff) | |
| download | rust-4e628a516a7c4f40b2fbecec580a2a41d6e60d89.tar.gz rust-4e628a516a7c4f40b2fbecec580a2a41d6e60d89.zip | |
add more info to error when calling npm
| -rw-r--r-- | src/tools/rustdoc-gui-test/src/main.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/tools/rustdoc-gui-test/src/main.rs b/src/tools/rustdoc-gui-test/src/main.rs index f9929f1f80d..dc902f8cb02 100644 --- a/src/tools/rustdoc-gui-test/src/main.rs +++ b/src/tools/rustdoc-gui-test/src/main.rs @@ -14,10 +14,16 @@ fn get_browser_ui_test_version_inner(npm: &Path, global: bool) -> Option<String> if global { command.arg("--global"); } - let lines = command - .output() - .map(|output| String::from_utf8_lossy(&output.stdout).into_owned()) - .unwrap_or(String::new()); + let lines = match command.output() { + Ok(output) => String::from_utf8_lossy(&output.stdout).into_owned(), + Err(e) => { + eprintln!( + "path to npm can be wrong, provided path: {npm:?}. Try to set npm path \ + in config.toml in [build.npm]", + ); + panic!("{:?}", e) + } + }; lines .lines() .find_map(|l| l.rsplit(':').next()?.strip_prefix("browser-ui-test@")) |
