use std::path::{Path, PathBuf};
use anyhow::{Result, bail};
use super::Manager;
use crate::home::{Home, user_home};
pub const DISPLAY: &str = "user service";
pub fn manager(_home: &Home) -> Result<Box<dyn Manager>> {
let _ = user_home()?;
Ok(Box::new(Unsupported))
}
struct Unsupported;
impl Manager for Unsupported {
fn install(&self, _binary: &Path, _moat_home: &Path) -> Result<PathBuf> {
bail!(
"`openmoat proxy install` is not supported on {} yet (#272 defers Standard-tier \
proxy routing on Windows); run `openmoat proxy` in a terminal to keep the proxy up",
std::env::consts::OS
)
}
fn uninstall(&self) -> Result<Option<PathBuf>> {
Ok(None)
}
}