add more info to error when calling npm
This commit is contained in:
parent
af36fbfc33
commit
4e628a516a
1 changed files with 10 additions and 4 deletions
|
|
@ -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@"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue