Skip to content

Commit

Permalink
fix ollama spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
ValiuchenkoVladyslav committed Dec 7, 2024
1 parent c9e8f18 commit 94f424a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions apps/desktop/core/src/ollama/tauri_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Check warning on line 8 in apps/desktop/core/src/ollama/tauri_commands.rs

View workflow job for this annotation

GitHub Actions / check-linting

spawned process is never `wait()`ed on
.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")]
Expand Down

0 comments on commit 94f424a

Please sign in to comment.