Skip to content

Rust library to identify your linux distribution 🦀

License

Notifications You must be signed in to change notification settings

krypt0nn/whatadistro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦀 whatadistro

Rust library to identify your linux distribution

Examples

Get current distro name

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

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

Compare current distro with some another

Can be used in an app to display a command to download optional dependency. For example, show apt install git for every debian-based system, which are Linux Mint, Ubuntu, Deepin, etc.

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);

Author: Nikita Podvirnyy

Licensed under MIT

About

Rust library to identify your linux distribution 🦀

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages