Skip to main content

program_path

Function program_path 

Source
pub fn program_path(tool: &str) -> PathBuf
Expand description

#1758: the program to spawn for tool: the path which resolves on PATH, or the bare name when it resolves nothing. Spawn tools through this rather than Command::new("<name>"). On Windows, Command looks up a bare name with .exe only, so an npm shim (npx.cmd, tsc.cmd) that detection finds through PATHEXT is never started. An explicit path to a .cmd is spawned correctly, with its arguments escaped.

Resolved through SystemToolbox::on_path, the same lookup detection uses, so the spawned program is the one a probe of tool reports.