Skip to content

Commit 306cb8e

Browse files
committed
fix: correct sidecar path
1 parent fbffd27 commit 306cb8e

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

  • standalone/src-tauri/src

standalone/src-tauri/src/db.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use anyhow::{Context, Result};
22
use rusqlite::Connection;
33
use serde_json::Value;
44
use std::path::{Path, PathBuf};
5-
use tauri::{path::BaseDirectory, AppHandle, Manager};
5+
use tauri::{AppHandle, Manager};
66
use tauri_plugin_cli::ArgData;
77

88
enum Source {
@@ -90,14 +90,18 @@ impl DatabaseHandle {
9090
}
9191
}
9292

93-
fn resolve_extension_path(app_handle: &AppHandle) -> Option<PathBuf> {
93+
fn resolve_extension_path(_app_handle: &AppHandle) -> Option<PathBuf> {
9494
let mut candidates: Vec<(&str, PathBuf)> = Vec::new();
95-
match app_handle.path().resolve(
96-
Path::new("bin").join("absurd-extension"),
97-
BaseDirectory::Resource,
98-
) {
99-
Ok(path) => candidates.push(("bundled", path)),
100-
Err(err) => log::debug!("Failed to resolve bundled extension path: {}", err),
95+
match std::env::current_exe() {
96+
Ok(current_exe) => {
97+
if let Some(exe_dir) = current_exe.parent() {
98+
candidates.push(("sidecar", exe_dir.join("absurd-extension")));
99+
candidates.push(("sidecar bin", exe_dir.join("bin").join("absurd-extension")));
100+
} else {
101+
log::warn!("Failed to resolve current executable directory");
102+
}
103+
}
104+
Err(err) => log::warn!("Failed to resolve current executable path: {}", err),
101105
}
102106

103107
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));

0 commit comments

Comments
 (0)