From 41a20d72b8d4ab7168b2afab67ceb438e13e33ef Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:06:13 -0300 Subject: [PATCH] Check if path points to valid julia binary --- src/utils.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils.rs b/src/utils.rs index b0977ea1..b5b8fad1 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -89,6 +89,14 @@ pub fn get_bin_dir() -> Result { Ok(path) } +pub fn is_valid_julia_path(julia_path: &PathBuf) -> bool { + return std::process::Command::new(julia_path) + .arg("-v") + .stdout(std::process::Stdio::null()) + .spawn() + .is_ok(); +} + pub fn get_arch() -> Result { if std::env::consts::ARCH == "x86" { return Ok("x86".to_string());