Support explicit tool path overrides via INTERCEPT_*_PATH

This commit is contained in:
Smittix
2026-02-26 12:13:48 +00:00
parent 70e4bc557b
commit d92146d678

View File

@@ -20,6 +20,12 @@ def check_tool(name: str) -> bool:
def get_tool_path(name: str) -> str | None:
"""Get the full path to a tool, checking standard PATH and extra locations."""
# Optional explicit override, e.g. INTERCEPT_RTL_FM_PATH=/opt/homebrew/bin/rtl_fm
env_key = f"INTERCEPT_{name.upper().replace('-', '_')}_PATH"
env_path = os.environ.get(env_key)
if env_path and os.path.isfile(env_path) and os.access(env_path, os.X_OK):
return env_path
# Prefer native Homebrew binaries on Apple Silicon to avoid mixing Rosetta
# /usr/local tools with arm64 Python/runtime.
if platform.system() == 'Darwin':