1个不稳定版本

0.1.0 2023年5月19日

#11 in #failed

Download history 65/week @ 2024-04-06 70/week @ 2024-04-13 93/week @ 2024-04-20 79/week @ 2024-04-27 117/week @ 2024-05-04 62/week @ 2024-05-11 92/week @ 2024-05-18 136/week @ 2024-05-25 121/week @ 2024-06-01 73/week @ 2024-06-08 128/week @ 2024-06-15 132/week @ 2024-06-22 289/week @ 2024-06-29 168/week @ 2024-07-06 123/week @ 2024-07-13 106/week @ 2024-07-20

723 每月下载量
pacmanager中使用

MIT许可证

9KB
164

🦀 whatadistro

Rust库用于识别您的Linux发行版

示例

获取当前发行版名称

let distro = whatadistro::identify()
    .expect("Failed to parse os-release file");

println!("Your distro name is {}", distro.name());

比较当前发行版与某个其他发行版

可用于应用程序中显示下载可选依赖项的命令。例如,对于基于debian的系统(如Linux Mint、Ubuntu、Deepin等),显示apt install git

let status = whatadistro::identify()
    .map(|distro| distro.is_similar("arch")) // whatadistro::Distro::Arch can be used as well
    .unwrap_or(false);

println!("Is current system arch-based: {:?}", status);

作者:Nikita Podvirnyy

许可协议:MIT

无运行时依赖项