pub(crate) fn check_server_installation(server_name: &str) -> bool {
let unix_cmd_str = &format!("which {} > /dev/null 2>&1", server_name); let (command, args) = match std::env::consts::OS {
"windows" => {
("where", vec![server_name])
}
_ => {
("sh", vec!["-c", unix_cmd_str])
}
};
let status = std::process::Command::new(command).args(args).status();
match status {
Ok(exit_status) => {
if exit_status.success() {
true
} else {
false
}
}
Err(e) => {
print!(" ? Could not determine installation status\n{}", e);
false
}
}
}