Browse Source

HALLELUJAH attempt to put flags for freebsd and openbsd

main_chirho
LoveJesus 3 months ago
parent
commit
ae6b6842a4
3 changed files with 6 additions and 5 deletions
  1. +1
    -1
      Cargo.lock
  2. +2
    -2
      Cargo.toml
  3. +3
    -2
      src/cli_chirho/cli_chirho.rs

+ 1
- 1
Cargo.lock View File

@ -1919,7 +1919,7 @@ dependencies = [
[[package]]
name = "rs_machine_input_chirho"
version = "0.1.1"
version = "0.1.2"
dependencies = [
"chrono",
"clap",


+ 2
- 2
Cargo.toml 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
[package]
name = "rs_machine_input_chirho"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
authors = ["Love Jesus <[email protected]>"]
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]


+ 3
- 2
src/cli_chirho/cli_chirho.rs 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 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<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>> {
use sys_info::{mem_info, cpu_num, disk_info};


Loading…
Cancel
Save