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
if let Ok(output) = std::process::Command::new("which")
.arg("opencode")
.output()
{
if output.status.success() {
let path = String::from_utf8_lossy(&output.stdout).trim().to_string();
if !path.is_empty() {
info!("[desktop:opencode] found binary in PATH: {}", path);
return Some(path);
// Use login shell to get full PATH (app bundles have limited PATH)
if let Ok(login_path) = detect_login_shell_path() {
for dir in login_path.split(':') {
let candidate = format!("{}/opencode", dir);
if Path::new(&candidate).exists() {
info!("[desktop:opencode] found binary in PATH: {}", candidate);
return Some(candidate);
}
}
}
warn!("[desktop:opencode] opencode binary not found in PATH");
warn!("[desktop:opencode] opencode binary not found");
None
}
+6 -1
View File
@@ -45,7 +45,12 @@
"exceptionDomain": "localhost",
"minimumSystemVersion": "14.0",
"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
},