MCPcopy Create free account
hub / github.com/bootc-dev/bootc / have_executable

Function have_executable

crates/lib/src/utils.rs:70–81  ·  view source on GitHub ↗
(name: &str)

Source from the content-addressed store, hash-verified

68}
69
70pub fn have_executable(name: &str) -> Result<bool> {
71 let Some(path) = std::env::var_os("PATH") else {
72 return Ok(false);
73 };
74 for mut elt in std::env::split_paths(&path) {
75 elt.push(name);
76 if elt.try_exists()? {
77 return Ok(true);
78 }
79 }
80 Ok(false)
81}
82
83/// Given a target directory, if it's a read-only mount, then remount it writable
84#[context("Opening {target} with writable mount")]

Callers 2

build_ukifyFunction · 0.85
supports_bootupdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected