MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / _find_executable

Function _find_executable

src/python/osrm/__main__.py:39–57  ·  view source on GitHub ↗
(exe_name)

Source from the content-addressed store, hash-verified

37
38
39def _find_executable(exe_name):
40 # 1. Installed wheel layout: osrm/bin/
41 candidate = _BIN_DIR / exe_name
42 if candidate.is_file():
43 return candidate
44
45 # 2. Editable install: look in CMake build directories
46 project_root = Path(__file__).parent.parent.parent.parent
47 for build_dir in sorted(project_root.glob("build/*/"), reverse=True):
48 candidate = build_dir / exe_name
49 if candidate.is_file():
50 return candidate
51
52 # 3. System PATH
53 found = shutil.which(exe_name)
54 if found:
55 return Path(found)
56
57 return None
58
59
60executable = _find_executable(exe_name)

Callers 1

__main__.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected