File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed
packages/desktop/src-tauri/src Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 99 - " nix/**"
1010 - " packages/app/**"
1111 - " packages/desktop/**"
12+ pull_request :
13+ paths :
14+ - " flake.nix"
15+ - " flake.lock"
16+ - " nix/**"
17+ - " packages/app/**"
18+ - " packages/desktop/**"
1219 workflow_dispatch :
1320
1421jobs :
Original file line number Diff line number Diff line change 1+ use tauri:: Manager ;
2+
13const CLI_INSTALL_DIR : & str = ".opencode/bin" ;
24const CLI_BINARY_NAME : & str = "opencode" ;
35
@@ -9,9 +11,10 @@ fn get_cli_install_path() -> Option<std::path::PathBuf> {
911 } )
1012}
1113
12- pub fn get_sidecar_path ( ) -> std:: path:: PathBuf {
13- tauri:: utils:: platform:: current_exe ( )
14- . expect ( "Failed to get current exe" )
14+ pub fn get_sidecar_path ( app : & tauri:: AppHandle ) -> std:: path:: PathBuf {
15+ // Get binary with symlinks support
16+ tauri:: process:: current_binary ( & app. env ( ) )
17+ . expect ( "Failed to get current binary" )
1518 . parent ( )
1619 . expect ( "Failed to get parent dir" )
1720 . join ( "opencode-cli" )
@@ -26,12 +29,12 @@ fn is_cli_installed() -> bool {
2629const INSTALL_SCRIPT : & str = include_str ! ( "../../../../install" ) ;
2730
2831#[ tauri:: command]
29- pub fn install_cli ( ) -> Result < String , String > {
32+ pub fn install_cli ( app : tauri :: AppHandle ) -> Result < String , String > {
3033 if cfg ! ( not( unix) ) {
3134 return Err ( "CLI installation is only supported on macOS & Linux" . to_string ( ) ) ;
3235 }
3336
34- let sidecar = get_sidecar_path ( ) ;
37+ let sidecar = get_sidecar_path ( & app ) ;
3538 if !sidecar. exists ( ) {
3639 return Err ( "Sidecar binary not found" . to_string ( ) ) ;
3740 }
@@ -108,7 +111,7 @@ pub fn sync_cli(app: tauri::AppHandle) -> Result<(), String> {
108111 cli_version, app_version
109112 ) ;
110113
111- install_cli ( ) ?;
114+ install_cli ( app ) ?;
112115
113116 println ! ( "Synced installed CLI" ) ;
114117
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ fn spawn_sidecar(app: &AppHandle, port: u32) -> CommandChild {
129129
130130 #[ cfg( not( target_os = "windows" ) ) ]
131131 let ( mut rx, child) = {
132- let sidecar = get_sidecar_path ( ) ;
132+ let sidecar = get_sidecar_path ( app ) ;
133133 let shell = get_user_shell ( ) ;
134134 app. shell ( )
135135 . command ( & shell)
You can’t perform that action at this time.
0 commit comments