Resolve a tool binary from the Composer bin directory.
(
binary_name: &'static str,
workspace_root: Option<&Path>,
bin_dir: &str,
)
| 186 | |
| 187 | /// Resolve a tool binary from the Composer bin directory. |
| 188 | fn resolve_from_bin_dir( |
| 189 | binary_name: &'static str, |
| 190 | workspace_root: Option<&Path>, |
| 191 | bin_dir: &str, |
| 192 | ) -> Option<ResolvedTool> { |
| 193 | let root = workspace_root?; |
| 194 | let candidate = root.join(bin_dir).join(binary_name); |
| 195 | if candidate.is_file() { |
| 196 | Some(ResolvedTool { |
| 197 | name: binary_name, |
| 198 | path: candidate, |
| 199 | }) |
| 200 | } else { |
| 201 | None |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | // ── Built-in formatter ────────────────────────────────────────────── |
| 206 |