diff --git a/src/main.rs b/src/main.rs index 7821e11..d8cc225 100644 --- a/src/main.rs +++ b/src/main.rs @@ -112,8 +112,6 @@ const ACTIONS: [Action; 13] = [ fn main() { let args: Args = Args::parse(); - println!("{}", system::specs::get_disk_usage()); - let line_count = helpers::file::get_file_linecount( &format!("{}{}.txt", helpers::paths::get_pony_path(), &args.pony) ); diff --git a/src/system/specs.rs b/src/system/specs.rs index 6937eab..a24320e 100644 --- a/src/system/specs.rs +++ b/src/system/specs.rs @@ -119,6 +119,27 @@ pub fn get_disk_usage() -> String { disk } +#[cfg(target_os = "linux")] +pub fn get_arch() -> String { + use std::process::Command; + + let mut arch = String::new(); + + let command = Command::new("lscpu") + .output() + .expect("Failed to execute process"); + + let command = String::from_utf8_lossy(&command.stdout); + + for line in command.lines() { + if line.contains("Architecture") { + arch = line.split_whitespace().last().unwrap().to_string(); + } + } + + arch +} + #[cfg(target_os = "windows")] pub fn get_arch() -> String { use std::process::Command; @@ -202,15 +223,6 @@ fn eval_ram(line: String) -> u128 { kbs / 1000 } -#[cfg(target_os = "linux")] -pub fn get_kernel() -> String { - let temp_buf: String = file_open("/proc/version"); - - temp_buf.split(" ") - .collect::>()[2] - .to_string() -} - #[cfg(target_os = "windows")] pub fn get_gpu() -> String { use std::process::Command;