From 94f424a759e5fe2bcb5dacc4fae5fc8a1bee8329 Mon Sep 17 00:00:00 2001 From: wladyslaw Date: Fri, 6 Dec 2024 17:26:27 -0800 Subject: [PATCH] fix ollama spawn --- .../desktop/core/src/ollama/tauri_commands.rs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/desktop/core/src/ollama/tauri_commands.rs b/apps/desktop/core/src/ollama/tauri_commands.rs index 842b959..e31558a 100644 --- a/apps/desktop/core/src/ollama/tauri_commands.rs +++ b/apps/desktop/core/src/ollama/tauri_commands.rs @@ -5,24 +5,24 @@ use crate::app_state::CommandState; pub fn start_ollama() -> Result<(), ()> { use std::os::windows::process::CommandExt; - let cmd = std::process::Command::new("ollama") + std::process::Command::new("ollama") .arg("serve") .creation_flags(0x08000000) // CREATE_NO_WINDOW - .spawn(); + .spawn() + .unwrap(); - match cmd { - Ok(_) => Ok(()), - Err(_) => Err(()), - } + Ok(()) } #[cfg(not(target_os = "windows"))] #[tauri::command(rename_all = "snake_case")] pub fn start_ollama() -> Result<(), ()> { - match std::process::Command::new("ollama").arg("serve").spawn() { - Ok(_) => Ok(()), - Err(_) => Err(()), - } + std::process::Command::new("ollama") + .arg("serve") + .spawn() + .unwrap(); + + Ok(()) } #[tauri::command(rename_all = "snake_case")]