use anyhow::Result;
mod dispatch;
#[cfg(target_os = "macos")]
mod macos;
#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "windows")]
mod windows;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SchemeStatus {
Installed {
path: String,
},
NotInstalled,
}
impl std::fmt::Display for SchemeStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Installed { path } => write!(f, "Installed at {path}"),
Self::NotInstalled => write!(f, "Not installed"),
}
}
}
pub fn install() -> Result<()> {
dispatch::platform_install()
}
pub fn uninstall() -> Result<()> {
dispatch::platform_uninstall()
}
pub fn status() -> Result<SchemeStatus> {
dispatch::platform_status()
}
#[cfg(test)]
#[path = "scheme_tests.rs"]
mod tests;