MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / find_executable

Function find_executable

crates/cli/src/detect.rs:6–12  ·  view source on GitHub ↗

Find an executable in the `PATH`.

(exe_name: impl AsRef<Path>)

Source from the content-addressed store, hash-verified

4
5/// Find an executable in the `PATH`.
6pub(crate) fn find_executable(exe_name: impl AsRef<Path>) -> Option<std::path::PathBuf> {
7 std::env::var_os("PATH").and_then(|paths| {
8 std::env::split_paths(&paths)
9 .map(|dir| dir.join(&exe_name))
10 .find(|x| x.is_file())
11 })
12}
13
14/// Check if `rustup` is installed (aka: Is in the `PATH`).
15pub(crate) fn has_rust_up() -> bool {

Callers 8

has_rust_upFunction · 0.85
has_rust_fmtFunction · 0.85
has_package_managerFunction · 0.85
check_for_cargoFunction · 0.85
check_for_dotnetFunction · 0.85
check_for_gitFunction · 0.85
build_cppFunction · 0.85

Calls 3

joinMethod · 0.80
findMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…