MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / npm_program

Function npm_program

build.rs:50–61  ·  view source on GitHub ↗

Locates a working npm executable (`npm.cmd` is the Windows launcher).

()

Source from the content-addressed store, hash-verified

48
49/// Locates a working npm executable (`npm.cmd` is the Windows launcher).
50fn 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
63fn run_npm(npm: &str, args: &[&str], dir: &Path) -> Result<(), String> {
64 println!(

Callers 1

Calls 2

statusMethod · 0.80
successMethod · 0.80

Tested by

no test coverage detected