{"id":23333895,"url":"https://github.com/schultyy/os_type","last_synced_at":"2025-04-07T13:07:18.829Z","repository":{"id":1768340,"uuid":"44494080","full_name":"schultyy/os_type","owner":"schultyy","description":"Rust library to detect the operating system type","archived":false,"fork":false,"pushed_at":"2023-09-03T15:11:12.000Z","size":81,"stargazers_count":31,"open_issues_count":10,"forks_count":18,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T23:35:29.725Z","etag":null,"topics":["linux","macos","operating-system","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schultyy.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-18T19:59:11.000Z","updated_at":"2024-11-06T17:36:15.000Z","dependencies_parsed_at":"2024-06-19T01:38:44.421Z","dependency_job_id":"bcff7f12-6aca-4997-936a-c61140a69b7d","html_url":"https://github.com/schultyy/os_type","commit_stats":{"total_commits":85,"total_committers":14,"mean_commits":6.071428571428571,"dds":0.3294117647058824,"last_synced_commit":"649551423a5b02525c8e34fa13a8f4b3c4741708"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2Fos_type","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2Fos_type/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2Fos_type/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2Fos_type/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schultyy","download_url":"https://codeload.github.com/schultyy/os_type/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657281,"owners_count":20974345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","macos","operating-system","rust","rust-lang"],"created_at":"2024-12-21T00:32:50.110Z","updated_at":"2025-04-07T13:07:18.808Z","avatar_url":"https://github.com/schultyy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Rust](https://github.com/schultyy/os_type/actions/workflows/rust.yml/badge.svg)](https://github.com/schultyy/os_type/actions/workflows/rust.yml)\n\n# os_type\nRust library to detect the operating system type, because sometimes you need to know.\n\n## Usage\n\nInclude this into your `Cargo.toml`:\n\n```toml\n[dependencies]\nos_type=\"2.6\"\n```\n\nIn your code:\n\n```rust\nextern crate os_type;\nlet os = os_type::current_platform();\nprintln!(\"Type: {:?}\", os.os_type);\nprintln!(\"Version: {}\", os.version);\n```\n\nOr to provide different handling on different operating systems:\n\n```rust\nmatch os_type::current_platform().os_type {\n  os_type::OSType::OSX =\u003e {\n    println!(\"This is probably an apple laptop!\");\n  }\n  os_type::OSType::Ubuntu =\u003e {\n    println!(\"This is running Ubuntu Linux!\");\n  }\n  _ =\u003e {\n    println!(\"Unknown Operating System\");\n  }\n}\n```\n\n\nUsing `os_type::current_platform().os_type`, expect one of these return values:\n\n- Unknown\n- Redhat\n- CentOS\n- OSX\n- Ubuntu\n- Debian\n- Arch\n- Manjaro\n- Alpine\n- Deepin\n- NixOS\n- Kali\n\nIf you need support for more OS types, please consider opening a Pull Request.\n\n## Requirements\n\nOn Linux based systems this library requires that [lsb_release](http://refspecs.linuxbase.org/LSB_2.0.1/LSB-PDA/LSB-PDA/lsbrelease.html) is installed.\n\n## Contributing\n\nBug reports and pull requests are welcome on [GitHub](https://github.com/schultyy/os_type).\nYou can find more information about contributing in the [CONTRIBUTING.md](https://github.com/schultyy/os_type/blob/master/CONTRIBUTING.md).\nThis project is intended to be a safe, welcoming space for collaboration and discussion, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org/version/1/4/) code of conduct.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschultyy%2Fos_type","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschultyy%2Fos_type","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschultyy%2Fos_type/lists"}