MCPcopy Create free account
hub / github.com/1jehuang/jcode / detect_pi_bin

Function detect_pi_bin

scripts/bench_memory_cli.py:74–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72
73
74def detect_pi_bin() -> str:
75 direct = shutil_which("pi")
76 if direct:
77 return direct
78 prefix = subprocess.check_output(["npm", "prefix", "-g"], text=True).strip()
79 candidate = Path(prefix) / "bin" / "pi"
80 if candidate.exists():
81 return str(candidate)
82 raise FileNotFoundError("could not find pi binary")
83
84
85def build_specs() -> dict[str, ToolSpec]:

Callers 1

build_specsFunction · 0.70

Calls 2

PathClass · 0.85
shutil_whichFunction · 0.70

Tested by

no test coverage detected