Locates a working npm executable (`npm.cmd` is the Windows launcher).
()
| 48 | |
| 49 | /// Locates a working npm executable (`npm.cmd` is the Windows launcher). |
| 50 | fn npm_program() -> Option<&'static str> { |
| 51 | ["npm", "npm.cmd"].into_iter().find(|candidate| { |
| 52 | Command::new(candidate) |
| 53 | .arg("--version") |
| 54 | .stdin(Stdio::null()) |
| 55 | .stdout(Stdio::null()) |
| 56 | .stderr(Stdio::null()) |
| 57 | .status() |
| 58 | .map(|status| status.success()) |
| 59 | .unwrap_or(false) |
| 60 | }) |
| 61 | } |
| 62 | |
| 63 | fn run_npm(npm: &str, args: &[&str], dir: &Path) -> Result<(), String> { |
| 64 | println!( |
no test coverage detected