()
| 347 | |
| 348 | impl Sources { |
| 349 | pub(crate) fn from_process() -> Self { |
| 350 | let home = dirs::home_dir(); |
| 351 | let workspace = match workspace_search_readable(home.as_deref()) |
| 352 | .map_err(Some) |
| 353 | .and_then(|()| { |
| 354 | find_repository_root().map_err(|error| match error { |
| 355 | CliError::RepositoryNotFound { .. } => None, |
| 356 | _ => Some(SourceError::WorkspaceLookup), |
| 357 | }) |
| 358 | }) { |
| 359 | Ok(root) => Ok(Some(root)), |
| 360 | Err(None) => linked_git_search_readable(home.as_deref()).map(|()| None), |
| 361 | Err(Some(error)) => Err(error), |
| 362 | }; |
| 363 | let install_source = std::env::current_exe() |
| 364 | .map(|exe| detect_source(&exe, &StdEnv).short_label()) |
| 365 | .unwrap_or("unknown") |
| 366 | .to_string(); |
| 367 | Self { |
| 368 | home, |
| 369 | integrations_root: atomic_agent::integrations::integrations_root() |
| 370 | .map_err(|_| SourceError::IntegrationsHome), |
| 371 | integrations_root_overridden: std::env::var_os("ATOMIC_INTEGRATIONS_HOME").is_some(), |
| 372 | workspace, |
| 373 | install_source, |
| 374 | } |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | // The shared discovery helper uses boolean file checks; preflight their |
nothing calls this directly
no test coverage detected