(binary: str, home: Path | None = None)
| 75 | |
| 76 | |
| 77 | def resolve_tinytex_binary(binary: str, home: Path | None = None) -> dict[str, Any]: |
| 78 | normalized = str(binary or "").strip() |
| 79 | if not normalized: |
| 80 | return {"binary": None, "path": None, "source": None, "root": None, "bin_dir": None} |
| 81 | for root in tinytex_root_candidates(home): |
| 82 | for bin_dir in _tinytex_bin_dirs(root): |
| 83 | for name in _binary_names(normalized): |
| 84 | candidate = bin_dir / name |
| 85 | if candidate.exists(): |
| 86 | return { |
| 87 | "binary": normalized, |
| 88 | "path": str(candidate), |
| 89 | "source": "tinytex", |
| 90 | "root": str(root), |
| 91 | "bin_dir": str(bin_dir), |
| 92 | } |
| 93 | return { |
| 94 | "binary": normalized, |
| 95 | "path": None, |
| 96 | "source": None, |
| 97 | "root": None, |
| 98 | "bin_dir": None, |
| 99 | } |
| 100 | |
| 101 | |
| 102 | def resolve_latex_binary(binary: str, home: Path | None = None) -> dict[str, Any]: |
no test coverage detected