HALLELUJAH attempt to put flags for freebsd and openbsd

This commit is contained in:
LoveJesus committed 2024-08-06 12:08:08 -06:00
1 parent 96c6a63b07
commit ae6b6842a4
3 files changed
+6 -5

No files matched your search

Generated
+1 -1
View File
@@ -1919,7 +1919,7 @@ dependencies = [
[[package]] [[package]]
name = "rs_machine_input_chirho" name = "rs_machine_input_chirho"
version = "0.1.1" version = "0.1.2"
dependencies = [ dependencies = [
"chrono", "chrono",
"clap", "clap",
+2 -2
View File
@@ -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 # 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] [package]
name = "rs_machine_input_chirho" name = "rs_machine_input_chirho"
version = "0.1.1" version = "0.1.2"
edition = "2021" edition = "2021"
authors = ["Love Jesus <[email protected]>"] authors = ["Love Jesus <[email protected]>"]
description = "A command-line tool to synchronize computer resource information with a remote database" 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] [default.databases.sqlite_database_chirho]
url = "sqlite:db_chirho.sqlite" 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" sys-info = "0.9"
[target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies] [target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies]
+3 -2
View File
@@ -53,7 +53,7 @@ fn collect_system_info_chirho() -> Result<SystemInfoChirho, Box<dyn Error>> {
let hostname_chirho = hostname::get()?.into_string().unwrap(); let hostname_chirho = hostname::get()?.into_string().unwrap();
let os_chirho = std::env::consts::OS.to_string(); 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()?; let (ram_mb_chirho, cpu_cores_chirho, storage_gb_chirho) = collect_linux_info_chirho()?;
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
@@ -74,7 +74,8 @@ fn collect_system_info_chirho() -> Result<SystemInfoChirho, Box<dyn Error>> {
}) })
} }
#[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<dyn Error>> { fn collect_linux_info_chirho() -> Result<(u64, u64, u64), Box<dyn Error>> {
use sys_info::{mem_info, cpu_num, disk_info}; use sys_info::{mem_info, cpu_num, disk_info};