@@ -2,7 +2,7 @@ use anyhow::{Context, Result};
22use rusqlite:: Connection ;
33use serde_json:: Value ;
44use std:: path:: { Path , PathBuf } ;
5- use tauri:: { path :: BaseDirectory , AppHandle , Manager } ;
5+ use tauri:: { AppHandle , Manager } ;
66use tauri_plugin_cli:: ArgData ;
77
88enum 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