MCPcopy Create free account
hub / github.com/Louisym/MiniCC / command_exists

Function command_exists

tutorials/14_bash_engine_deep_dive.py:203–206  ·  view source on GitHub ↗

检查系统命令是否存在 — 源码 sandbox.rs:280-283

(command: str)

Source from the content-addressed store, hash-verified

201
202
203def command_exists(command: str) -> bool:
204 """检查系统命令是否存在 — 源码 sandbox.rs:280-283"""
205 path_dirs = os.environ.get("PATH", "").split(os.pathsep)
206 return any(os.path.exists(os.path.join(d, command)) for d in path_dirs)
207
208
209def normalize_mounts(mounts: List[str], cwd: Path) -> List[str]:

Callers 1

resolve_sandbox_statusFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected