Skip to main content

resolve_program

Function resolve_program 

Source
pub fn resolve_program(dir: &Path, program: &str) -> PathBuf
Expand description

Resolve program for execution inside dir.

A relative program that contains a path separator (e.g. ./build.sh, scripts/run) is a path, and the command’s contract is “run in each worktree” — so it is joined onto dir. This pins the resolution to the target worktree regardless of whether the platform resolves a relative executable against the parent’s or the child’s cwd (the order differs across OSes for std::process::Command + current_dir). Bare names (no separator) stay PATH lookups, and absolute paths are left as-is.