style: apply cargo fmt to install_ollama_from_bundle
This commit is contained in:
parent
dffd26a6fd
commit
2d02cfa9e8
@ -148,9 +148,7 @@ pub async fn get_audit_log(
|
|||||||
// On Unix, writing to /usr/local/bin requires elevated privileges. If the operation fails with
|
// On Unix, writing to /usr/local/bin requires elevated privileges. If the operation fails with
|
||||||
// PermissionDenied the caller receives an actionable error message.
|
// PermissionDenied the caller receives an actionable error message.
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn install_ollama_from_bundle(
|
pub async fn install_ollama_from_bundle(app: tauri::AppHandle) -> Result<String, String> {
|
||||||
app: tauri::AppHandle,
|
|
||||||
) -> Result<String, String> {
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use tauri::Manager;
|
use tauri::Manager;
|
||||||
@ -160,9 +158,11 @@ pub async fn install_ollama_from_bundle(
|
|||||||
.resource_dir()
|
.resource_dir()
|
||||||
.map_err(|e: tauri::Error| e.to_string())?;
|
.map_err(|e: tauri::Error| e.to_string())?;
|
||||||
|
|
||||||
let resource_path = resource_dir
|
let resource_path = resource_dir.join("ollama").join(if cfg!(windows) {
|
||||||
.join("ollama")
|
"ollama.exe"
|
||||||
.join(if cfg!(windows) { "ollama.exe" } else { "ollama" });
|
} else {
|
||||||
|
"ollama"
|
||||||
|
});
|
||||||
|
|
||||||
if !resource_path.exists() {
|
if !resource_path.exists() {
|
||||||
return Err("Bundled Ollama not found in resources".to_string());
|
return Err("Bundled Ollama not found in resources".to_string());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user