1#![cfg_attr(not(test), warn(unused_crate_dependencies))]
4#![cfg_attr(docsrs, feature(doc_cfg))]
5
6mod installer;
7mod launcher;
8mod registry;
9
10pub use installer::InstallerError;
11pub use launcher::{LauncherError, run};
12
13pub fn installed_extensions() -> Result<Vec<(String, String)>, String> {
17 let reg = registry::Registry::load()?;
18 let mut exts: Vec<(String, String)> = reg
19 .extensions
20 .into_iter()
21 .filter(|(_, state)| !state.installed_version.is_empty())
22 .map(|(name, state)| (name, state.description))
23 .collect();
24 exts.sort_by(|(a, _), (b, _)| a.cmp(b));
25 Ok(exts)
26}
27
28#[cfg(test)]
29pub(crate) mod test_util {
30 pub(crate) static ENV_MUTEX: std::sync::Mutex<()> = std::sync::Mutex::new(());
33}