MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / command_exists

Function command_exists

e2e/rust/src/harness/container.rs:260–268  ·  view source on GitHub ↗
(command: &str)

Source from the content-addressed store, hash-verified

258}
259
260fn command_exists(command: &str) -> bool {
261 if command.contains(std::path::MAIN_SEPARATOR) {
262 return is_executable_file(Path::new(command));
263 }
264
265 std::env::var_os("PATH").is_some_and(|path| {
266 std::env::split_paths(&path).any(|dir| is_executable_file(&dir.join(command)))
267 })
268}
269
270fn docker_is_podman_shim() -> bool {
271 if !command_exists("docker") {

Callers 2

command_existsMethod · 0.85
docker_is_podman_shimFunction · 0.85

Calls 1

is_executable_fileFunction · 0.85

Tested by

no test coverage detected