kelpdot 2.1.9

Simple dotfiles manager
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::lib::packagemangers::portage::Portage;
use crate::lib::structs::pm::PackageManager;
use crate::lib::util::os;
pub fn get_distro_pm() -> anyhow::Result<impl PackageManager> {
    let os = os::get_host_os()?;
    if os.submatches.iter().any(|x| x == "gentoo") || os.name == "gentoo" {
        return Ok(Portage::new());
    }
    Err(anyhow::Error::new(std::io::Error::new(
        std::io::ErrorKind::NotFound,
        "Can not find OS packagemanger!",
    )))
}