worktree_io/scheme/
mod.rs1use anyhow::Result;
2
3mod dispatch;
4
5#[cfg(target_os = "macos")]
6mod macos;
7
8#[cfg(target_os = "linux")]
9mod linux;
10
11#[cfg(target_os = "windows")]
12mod windows;
13
14#[derive(Debug, Clone, PartialEq, Eq)]
16pub enum SchemeStatus {
17 Installed {
19 path: String,
21 },
22 NotInstalled,
24}
25
26impl std::fmt::Display for SchemeStatus {
27 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28 match self {
29 Self::Installed { path } => write!(f, "Installed at {path}"),
30 Self::NotInstalled => write!(f, "Not installed"),
31 }
32 }
33}
34
35pub fn install() -> Result<()> {
41 dispatch::platform_install()
42}
43
44pub fn uninstall() -> Result<()> {
50 dispatch::platform_uninstall()
51}
52
53pub fn status() -> Result<SchemeStatus> {
59 dispatch::platform_status()
60}
61
62#[cfg(test)]
63#[path = "scheme_tests.rs"]
64mod tests;