Refactor opencode binary resolution to use login shell for full PATH and enhance dmg configuration in tauri.conf.json

This commit is contained in:
Bohdan Triapitsyn
2025-12-07 19:50:42 +02:00
parent 4b2edf7318
commit 9e8501942f
2 changed files with 14 additions and 12 deletions
@@ -513,21 +513,18 @@ fn resolve_opencode_binary() -> Option<String> {
} }
} }
// Find in PATH // Use login shell to get full PATH (app bundles have limited PATH)
if let Ok(output) = std::process::Command::new("which") if let Ok(login_path) = detect_login_shell_path() {
.arg("opencode") for dir in login_path.split(':') {
.output() let candidate = format!("{}/opencode", dir);
{ if Path::new(&candidate).exists() {
if output.status.success() { info!("[desktop:opencode] found binary in PATH: {}", candidate);
let path = String::from_utf8_lossy(&output.stdout).trim().to_string(); return Some(candidate);
if !path.is_empty() {
info!("[desktop:opencode] found binary in PATH: {}", path);
return Some(path);
} }
} }
} }
warn!("[desktop:opencode] opencode binary not found in PATH"); warn!("[desktop:opencode] opencode binary not found");
None None
} }
+6 -1
View File
@@ -45,7 +45,12 @@
"exceptionDomain": "localhost", "exceptionDomain": "localhost",
"minimumSystemVersion": "14.0", "minimumSystemVersion": "14.0",
"signingIdentity": null, "signingIdentity": null,
"infoPlist": "Info.plist" "infoPlist": "Info.plist",
"dmg": {
"appPosition": { "x": 180, "y": 170 },
"applicationFolderPosition": { "x": 480, "y": 170 },
"windowSize": { "width": 660, "height": 400 }
}
}, },
"createUpdaterArtifacts": true "createUpdaterArtifacts": true
}, },