fix: improve macOS LS path detection
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -58,7 +58,11 @@ impl Platform {
|
|||||||
let ca_cert_path = env_or("SSL_CERT_FILE", default_ca_cert_path);
|
let ca_cert_path = env_or("SSL_CERT_FILE", default_ca_cert_path);
|
||||||
let ls_user = env_or("ZEROGRAVITY_LS_USER", || "zerogravity-ls".into());
|
let ls_user = env_or("ZEROGRAVITY_LS_USER", || "zerogravity-ls".into());
|
||||||
let state_db_path = env_or("ZEROGRAVITY_STATE_DB", || default_state_db_path(&home));
|
let state_db_path = env_or("ZEROGRAVITY_STATE_DB", || default_state_db_path(&home));
|
||||||
let dns_redirect_so_path = format!("{}/dns-redirect.so", &data_dir);
|
let dns_redirect_so_path = if cfg!(target_os = "macos") {
|
||||||
|
format!("{}/dns-redirect.dylib", &data_dir)
|
||||||
|
} else {
|
||||||
|
format!("{}/dns-redirect.so", &data_dir)
|
||||||
|
};
|
||||||
|
|
||||||
let config_dir = PathBuf::from(&config_dir);
|
let config_dir = PathBuf::from(&config_dir);
|
||||||
let token_path = config_dir.join("token");
|
let token_path = config_dir.join("token");
|
||||||
@@ -104,18 +108,19 @@ fn default_ls_binary_path() -> String {
|
|||||||
fn default_ls_binary_path() -> String {
|
fn default_ls_binary_path() -> String {
|
||||||
let home = home_dir();
|
let home = home_dir();
|
||||||
// Check both /Applications and ~/Applications
|
// Check both /Applications and ~/Applications
|
||||||
|
let candidates = ["language_server_macos_arm", "language_server_darwin_arm64"];
|
||||||
for base in &[
|
for base in &[
|
||||||
"/Applications/Antigravity.app",
|
"/Applications/Antigravity.app",
|
||||||
&format!("{home}/Applications/Antigravity.app"),
|
&format!("{home}/Applications/Antigravity.app"),
|
||||||
] {
|
] {
|
||||||
let path = format!(
|
for name in candidates {
|
||||||
"{base}/Contents/Resources/app/extensions/antigravity/bin/language_server_darwin_arm64"
|
let path = format!("{base}/Contents/Resources/app/extensions/antigravity/bin/{name}");
|
||||||
);
|
if std::path::Path::new(&path).exists() {
|
||||||
if std::path::Path::new(&path).exists() {
|
return path;
|
||||||
return path;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"/Applications/Antigravity.app/Contents/Resources/app/extensions/antigravity/bin/language_server_darwin_arm64".into()
|
"/Applications/Antigravity.app/Contents/Resources/app/extensions/antigravity/bin/language_server_macos_arm".into()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
@@ -295,9 +300,9 @@ pub fn supports_uid_isolation() -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if LD_PRELOAD DNS redirect is supported (Linux only).
|
/// Returns true if DNS redirect preload is supported (Linux/macOS).
|
||||||
pub fn supports_ld_preload() -> bool {
|
pub fn supports_ld_preload() -> bool {
|
||||||
cfg!(target_os = "linux")
|
cfg!(any(target_os = "linux", target_os = "macos"))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Reference in New Issue
Block a user