Refactor opencode binary resolution to use login shell for full PATH and enhance dmg configuration in tauri.conf.json
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user