Skip to main content

command_exists

Function command_exists 

Source
pub fn command_exists(name: &str) -> ScriptResult<bool>
Expand description

Checks if an executable exists in PATH.

ยงExample

use bare_script::shell::command_exists;

assert!(command_exists("ls").unwrap_or(false) || command_exists("dir").unwrap_or(false));