Skip to main content

command_exists

Function command_exists 

Source
pub fn command_exists(cmd: &str) -> bool
Expand description

Check if a command exists in the system PATH.

Uses which on Unix systems to check for command availability. Returns true if the command is found, false otherwise.

§Validation

  • VAL-INFRA-016: command_exists utility function

§Examples

use rusty_stack::installers::common::utils::command_exists;

if command_exists("python3") {
    println!("Python 3 is available");
}