MCPcopy Create free account
hub / github.com/delinoio/oss / npm_exec_fallback_for_command

Function npm_exec_fallback_for_command

crates/nodeup/src/command_diagnostics.rs:247–260  ·  view source on GitHub ↗
(
    runtime_root: Option<&Path>,
    command: &str,
    direct_executable_exists: bool,
)

Source from the content-addressed store, hash-verified

245}
246
247fn npm_exec_fallback_for_command(
248 runtime_root: Option<&Path>,
249 command: &str,
250 direct_executable_exists: bool,
251) -> Option<PathBuf> {
252 if direct_executable_exists || !matches!(command, "yarn" | "pnpm") {
253 return None;
254 }
255
256 let npm_path =
257 selected_existing_or_primary(&runtime_executable_candidate_paths(runtime_root?, "npm"));
258
259 runtime_executable_is_runnable(&npm_path).then_some(npm_path)
260}
261
262fn availability_mode(
263 direct_executable_runnable: bool,

Callers 2

for_resolved_runtimeMethod · 0.85
for_linked_runtimeMethod · 0.85

Tested by

no test coverage detected