os_type
Rust library to detect the operating system type
Usage
Include this into your Cargo.toml
:
[]
="2.2"
In your code:
extern crate os_type;
let os = current_platform;
println!;
println!;
Or to provide different handling on different operating systems:
match current_platform.os_type
Right now, the following operating system types can be returned:
- Unknown
- Redhat
- CentOS
- OSX
- Ubuntu
- Debian
- Arch
- Manjaro
- Alpine
If you need support for more OS types, I am looking forward to your Pull Request.
Requirements
On Linux based systems this library requires that lsb_release is installed.
Contributing
Bug reports and pull requests are welcome on GitHub. You can find more information about contributing in the CONTRIBUTING.md. This project is intended to be a safe, welcoming space for collaboration and discussion, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
MIT