From ae6b6842a4ffaeb2a9b4bae2df935e78b615e695 Mon Sep 17 00:00:00 2001 From: LoveJesus Date: Tue, 6 Aug 2024 12:08:08 -0600 Subject: [PATCH] HALLELUJAH attempt to put flags for freebsd and openbsd --- Cargo.lock | 2 +- Cargo.toml | 4 ++-- src/cli_chirho/cli_chirho.rs | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e8cd32c..156ca6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1919,7 +1919,7 @@ dependencies = [ [[package]] name = "rs_machine_input_chirho" -version = "0.1.1" +version = "0.1.2" dependencies = [ "chrono", "clap", diff --git a/Cargo.toml b/Cargo.toml index 53964ff..d530322 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ # For God so loved the world, that He gave His only begotten Son, that all who believe in Him should not perish but have everlasting life [package] name = "rs_machine_input_chirho" -version = "0.1.1" +version = "0.1.2" edition = "2021" authors = ["Love Jesus "] description = "A command-line tool to synchronize computer resource information with a remote database" @@ -32,7 +32,7 @@ features = ["sqlx_sqlite"] [default.databases.sqlite_database_chirho] url = "sqlite:db_chirho.sqlite" -[target.'cfg(target_os = "linux")'.dependencies] +[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))'.dependencies] sys-info = "0.9" [target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies] diff --git a/src/cli_chirho/cli_chirho.rs b/src/cli_chirho/cli_chirho.rs index 3e07d4c..3e95a2a 100644 --- a/src/cli_chirho/cli_chirho.rs +++ b/src/cli_chirho/cli_chirho.rs @@ -53,7 +53,7 @@ fn collect_system_info_chirho() -> Result> { let hostname_chirho = hostname::get()?.into_string().unwrap(); let os_chirho = std::env::consts::OS.to_string(); - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))] let (ram_mb_chirho, cpu_cores_chirho, storage_gb_chirho) = collect_linux_info_chirho()?; #[cfg(target_os = "windows")] @@ -74,7 +74,8 @@ fn collect_system_info_chirho() -> Result> { }) } -#[cfg(target_os = "linux")] +// target linux, freebsd or openbsd +#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))] fn collect_linux_info_chirho() -> Result<(u64, u64, u64), Box> { use sys_info::{mem_info, cpu_num, disk_info};